id
int64
0
190k
prompt
stringlengths
21
13.4M
docstring
stringlengths
1
12k
25,399
import flatbuffers from flatbuffers.compat import import_numpy def AddFusedActivationFunction(builder, fusedActivationFunction): builder.PrependInt8Slot(1, fusedActivationFunction, 0) The provided code snippet includes necessary dependencies for implementing the `SVDFOptionsAddFusedActivationFunction` function. Write ...
This method is deprecated. Please switch to AddFusedActivationFunction.
25,400
import flatbuffers from flatbuffers.compat import import_numpy def AddAsymmetricQuantizeInputs(builder, asymmetricQuantizeInputs): builder.PrependBoolSlot(2, asymmetricQuantizeInputs, 0) The provided code snippet includes necessary dependencies for implementing the `SVDFOptionsAddAsymmetricQuantizeInputs` function. Wr...
This method is deprecated. Please switch to AddAsymmetricQuantizeInputs.
25,401
import flatbuffers from flatbuffers.compat import import_numpy def End(builder): return builder.EndObject() The provided code snippet includes necessary dependencies for implementing the `SVDFOptionsEnd` function. Write a Python function `def SVDFOptionsEnd(builder)` to solve the following problem: This method is depr...
This method is deprecated. Please switch to End.
25,402
import flatbuffers from flatbuffers.compat import import_numpy def Start(builder): builder.StartObject(2) The provided code snippet includes necessary dependencies for implementing the `RandomOptionsStart` function. Write a Python function `def RandomOptionsStart(builder)` to solve the following problem: This method i...
This method is deprecated. Please switch to Start.
25,403
import flatbuffers from flatbuffers.compat import import_numpy def AddSeed(builder, seed): builder.PrependInt64Slot(0, seed, 0) The provided code snippet includes necessary dependencies for implementing the `RandomOptionsAddSeed` function. Write a Python function `def RandomOptionsAddSeed(builder, seed)` to solve the ...
This method is deprecated. Please switch to AddSeed.
25,404
import flatbuffers from flatbuffers.compat import import_numpy def AddSeed2(builder, seed2): builder.PrependInt64Slot(1, seed2, 0) The provided code snippet includes necessary dependencies for implementing the `RandomOptionsAddSeed2` function. Write a Python function `def RandomOptionsAddSeed2(builder, seed2)` to solv...
This method is deprecated. Please switch to AddSeed2.
25,405
import flatbuffers from flatbuffers.compat import import_numpy def End(builder): return builder.EndObject() The provided code snippet includes necessary dependencies for implementing the `RandomOptionsEnd` function. Write a Python function `def RandomOptionsEnd(builder)` to solve the following problem: This method is ...
This method is deprecated. Please switch to End.
25,406
import flatbuffers from flatbuffers.compat import import_numpy def Start(builder): builder.StartObject(0) The provided code snippet includes necessary dependencies for implementing the `FloorModOptionsStart` function. Write a Python function `def FloorModOptionsStart(builder)` to solve the following problem: This meth...
This method is deprecated. Please switch to Start.
25,407
import flatbuffers from flatbuffers.compat import import_numpy def End(builder): return builder.EndObject() The provided code snippet includes necessary dependencies for implementing the `FloorModOptionsEnd` function. Write a Python function `def FloorModOptionsEnd(builder)` to solve the following problem: This method...
This method is deprecated. Please switch to End.
25,408
import flatbuffers from flatbuffers.compat import import_numpy def Start(builder): builder.StartObject(0) The provided code snippet includes necessary dependencies for implementing the `ExpandDimsOptionsStart` function. Write a Python function `def ExpandDimsOptionsStart(builder)` to solve the following problem: This ...
This method is deprecated. Please switch to Start.
25,409
import flatbuffers from flatbuffers.compat import import_numpy def End(builder): return builder.EndObject() The provided code snippet includes necessary dependencies for implementing the `ExpandDimsOptionsEnd` function. Write a Python function `def ExpandDimsOptionsEnd(builder)` to solve the following problem: This me...
This method is deprecated. Please switch to End.
25,410
import flatbuffers from flatbuffers.compat import import_numpy def Start(builder): builder.StartObject(2) The provided code snippet includes necessary dependencies for implementing the `ConcatenationOptionsStart` function. Write a Python function `def ConcatenationOptionsStart(builder)` to solve the following problem:...
This method is deprecated. Please switch to Start.
25,411
import flatbuffers from flatbuffers.compat import import_numpy def AddAxis(builder, axis): builder.PrependInt32Slot(0, axis, 0) The provided code snippet includes necessary dependencies for implementing the `ConcatenationOptionsAddAxis` function. Write a Python function `def ConcatenationOptionsAddAxis(builder, axis)`...
This method is deprecated. Please switch to AddAxis.
25,412
import flatbuffers from flatbuffers.compat import import_numpy def AddFusedActivationFunction(builder, fusedActivationFunction): builder.PrependInt8Slot(1, fusedActivationFunction, 0) The provided code snippet includes necessary dependencies for implementing the `ConcatenationOptionsAddFusedActivationFunction` functio...
This method is deprecated. Please switch to AddFusedActivationFunction.
25,413
import flatbuffers from flatbuffers.compat import import_numpy def End(builder): return builder.EndObject() The provided code snippet includes necessary dependencies for implementing the `ConcatenationOptionsEnd` function. Write a Python function `def ConcatenationOptionsEnd(builder)` to solve the following problem: T...
This method is deprecated. Please switch to End.
25,414
import flatbuffers from flatbuffers.compat import import_numpy def Start(builder): builder.StartObject(0) The provided code snippet includes necessary dependencies for implementing the `Rfft2dOptionsStart` function. Write a Python function `def Rfft2dOptionsStart(builder)` to solve the following problem: This method i...
This method is deprecated. Please switch to Start.
25,415
import flatbuffers from flatbuffers.compat import import_numpy def End(builder): return builder.EndObject() The provided code snippet includes necessary dependencies for implementing the `Rfft2dOptionsEnd` function. Write a Python function `def Rfft2dOptionsEnd(builder)` to solve the following problem: This method is ...
This method is deprecated. Please switch to End.
25,416
import flatbuffers from flatbuffers.compat import import_numpy def Start(builder): builder.StartObject(0) The provided code snippet includes necessary dependencies for implementing the `LogSoftmaxOptionsStart` function. Write a Python function `def LogSoftmaxOptionsStart(builder)` to solve the following problem: This ...
This method is deprecated. Please switch to Start.
25,417
import flatbuffers from flatbuffers.compat import import_numpy def End(builder): return builder.EndObject() The provided code snippet includes necessary dependencies for implementing the `LogSoftmaxOptionsEnd` function. Write a Python function `def LogSoftmaxOptionsEnd(builder)` to solve the following problem: This me...
This method is deprecated. Please switch to End.
25,418
import flatbuffers from flatbuffers.compat import import_numpy def Start(builder): builder.StartObject(0) The provided code snippet includes necessary dependencies for implementing the `RangeOptionsStart` function. Write a Python function `def RangeOptionsStart(builder)` to solve the following problem: This method is ...
This method is deprecated. Please switch to Start.
25,419
import flatbuffers from flatbuffers.compat import import_numpy def End(builder): return builder.EndObject() The provided code snippet includes necessary dependencies for implementing the `RangeOptionsEnd` function. Write a Python function `def RangeOptionsEnd(builder)` to solve the following problem: This method is de...
This method is deprecated. Please switch to End.
25,420
import flatbuffers from flatbuffers.compat import import_numpy def Start(builder): builder.StartObject(4) The provided code snippet includes necessary dependencies for implementing the `ResizeBilinearOptionsStart` function. Write a Python function `def ResizeBilinearOptionsStart(builder)` to solve the following proble...
This method is deprecated. Please switch to Start.
25,421
import flatbuffers from flatbuffers.compat import import_numpy def AddAlignCorners(builder, alignCorners): builder.PrependBoolSlot(2, alignCorners, 0) The provided code snippet includes necessary dependencies for implementing the `ResizeBilinearOptionsAddAlignCorners` function. Write a Python function `def ResizeBilin...
This method is deprecated. Please switch to AddAlignCorners.
25,422
import flatbuffers from flatbuffers.compat import import_numpy def AddHalfPixelCenters(builder, halfPixelCenters): builder.PrependBoolSlot(3, halfPixelCenters, 0) The provided code snippet includes necessary dependencies for implementing the `ResizeBilinearOptionsAddHalfPixelCenters` function. Write a Python function ...
This method is deprecated. Please switch to AddHalfPixelCenters.
25,423
import flatbuffers from flatbuffers.compat import import_numpy def End(builder): return builder.EndObject() The provided code snippet includes necessary dependencies for implementing the `ResizeBilinearOptionsEnd` function. Write a Python function `def ResizeBilinearOptionsEnd(builder)` to solve the following problem:...
This method is deprecated. Please switch to End.
25,424
import flatbuffers from flatbuffers.compat import import_numpy def Start(builder): builder.StartObject(0) The provided code snippet includes necessary dependencies for implementing the `QuantizeOptionsStart` function. Write a Python function `def QuantizeOptionsStart(builder)` to solve the following problem: This meth...
This method is deprecated. Please switch to Start.
25,425
import flatbuffers from flatbuffers.compat import import_numpy def End(builder): return builder.EndObject() The provided code snippet includes necessary dependencies for implementing the `QuantizeOptionsEnd` function. Write a Python function `def QuantizeOptionsEnd(builder)` to solve the following problem: This method...
This method is deprecated. Please switch to End.
25,426
import flatbuffers from flatbuffers.compat import import_numpy def Start(builder): builder.StartObject(4) The provided code snippet includes necessary dependencies for implementing the `FakeQuantOptionsStart` function. Write a Python function `def FakeQuantOptionsStart(builder)` to solve the following problem: This me...
This method is deprecated. Please switch to Start.
25,427
import flatbuffers from flatbuffers.compat import import_numpy def AddMin(builder, min): builder.PrependFloat32Slot(0, min, 0.0) The provided code snippet includes necessary dependencies for implementing the `FakeQuantOptionsAddMin` function. Write a Python function `def FakeQuantOptionsAddMin(builder, min)` to solve ...
This method is deprecated. Please switch to AddMin.
25,428
import flatbuffers from flatbuffers.compat import import_numpy def AddMax(builder, max): builder.PrependFloat32Slot(1, max, 0.0) The provided code snippet includes necessary dependencies for implementing the `FakeQuantOptionsAddMax` function. Write a Python function `def FakeQuantOptionsAddMax(builder, max)` to solve ...
This method is deprecated. Please switch to AddMax.
25,429
import flatbuffers from flatbuffers.compat import import_numpy def AddNumBits(builder, numBits): builder.PrependInt32Slot(2, numBits, 0) The provided code snippet includes necessary dependencies for implementing the `FakeQuantOptionsAddNumBits` function. Write a Python function `def FakeQuantOptionsAddNumBits(builder,...
This method is deprecated. Please switch to AddNumBits.
25,430
import flatbuffers from flatbuffers.compat import import_numpy def AddNarrowRange(builder, narrowRange): builder.PrependBoolSlot(3, narrowRange, 0) The provided code snippet includes necessary dependencies for implementing the `FakeQuantOptionsAddNarrowRange` function. Write a Python function `def FakeQuantOptionsAddN...
This method is deprecated. Please switch to AddNarrowRange.
25,431
import flatbuffers from flatbuffers.compat import import_numpy def End(builder): return builder.EndObject() The provided code snippet includes necessary dependencies for implementing the `FakeQuantOptionsEnd` function. Write a Python function `def FakeQuantOptionsEnd(builder)` to solve the following problem: This meth...
This method is deprecated. Please switch to End.
25,432
import flatbuffers from flatbuffers.compat import import_numpy def Start(builder): builder.StartObject(4) The provided code snippet includes necessary dependencies for implementing the `OperatorCodeStart` function. Write a Python function `def OperatorCodeStart(builder)` to solve the following problem: This method is ...
This method is deprecated. Please switch to Start.
25,433
import flatbuffers from flatbuffers.compat import import_numpy def AddDeprecatedBuiltinCode(builder, deprecatedBuiltinCode): builder.PrependInt8Slot(0, deprecatedBuiltinCode, 0) The provided code snippet includes necessary dependencies for implementing the `OperatorCodeAddDeprecatedBuiltinCode` function. Write a Pytho...
This method is deprecated. Please switch to AddDeprecatedBuiltinCode.
25,434
import flatbuffers from flatbuffers.compat import import_numpy def AddCustomCode(builder, customCode): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(customCode), 0) The provided code snippet includes necessary dependencies for implementing the `OperatorCodeAddCustomCode` functio...
This method is deprecated. Please switch to AddCustomCode.
25,435
import flatbuffers from flatbuffers.compat import import_numpy def AddVersion(builder, version): builder.PrependInt32Slot(2, version, 1) The provided code snippet includes necessary dependencies for implementing the `OperatorCodeAddVersion` function. Write a Python function `def OperatorCodeAddVersion(builder, version...
This method is deprecated. Please switch to AddVersion.
25,436
import flatbuffers from flatbuffers.compat import import_numpy def AddBuiltinCode(builder, builtinCode): builder.PrependInt32Slot(3, builtinCode, 0) The provided code snippet includes necessary dependencies for implementing the `OperatorCodeAddBuiltinCode` function. Write a Python function `def OperatorCodeAddBuiltinC...
This method is deprecated. Please switch to AddBuiltinCode.
25,437
import flatbuffers from flatbuffers.compat import import_numpy def End(builder): return builder.EndObject() The provided code snippet includes necessary dependencies for implementing the `OperatorCodeEnd` function. Write a Python function `def OperatorCodeEnd(builder)` to solve the following problem: This method is de...
This method is deprecated. Please switch to End.
25,438
import flatbuffers from flatbuffers.compat import import_numpy def Start(builder): builder.StartObject(9) The provided code snippet includes necessary dependencies for implementing the `OperatorStart` function. Write a Python function `def OperatorStart(builder)` to solve the following problem: This method is deprecat...
This method is deprecated. Please switch to Start.
25,439
import flatbuffers from flatbuffers.compat import import_numpy def AddOpcodeIndex(builder, opcodeIndex): builder.PrependUint32Slot(0, opcodeIndex, 0) The provided code snippet includes necessary dependencies for implementing the `OperatorAddOpcodeIndex` function. Write a Python function `def OperatorAddOpcodeIndex(bui...
This method is deprecated. Please switch to AddOpcodeIndex.
25,440
import flatbuffers from flatbuffers.compat import import_numpy def AddInputs(builder, inputs): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(inputs), 0) The provided code snippet includes necessary dependencies for implementing the `OperatorAddInputs` function. Write a Python fu...
This method is deprecated. Please switch to AddInputs.
25,441
import flatbuffers from flatbuffers.compat import import_numpy def StartInputsVector(builder, numElems): return builder.StartVector(4, numElems, 4) The provided code snippet includes necessary dependencies for implementing the `OperatorStartInputsVector` function. Write a Python function `def OperatorStartInputsVector...
This method is deprecated. Please switch to Start.
25,442
import flatbuffers from flatbuffers.compat import import_numpy def AddOutputs(builder, outputs): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(outputs), 0) The provided code snippet includes necessary dependencies for implementing the `OperatorAddOutputs` function. Write a Pytho...
This method is deprecated. Please switch to AddOutputs.
25,443
import flatbuffers from flatbuffers.compat import import_numpy def StartOutputsVector(builder, numElems): return builder.StartVector(4, numElems, 4) The provided code snippet includes necessary dependencies for implementing the `OperatorStartOutputsVector` function. Write a Python function `def OperatorStartOutputsVec...
This method is deprecated. Please switch to Start.
25,444
import flatbuffers from flatbuffers.compat import import_numpy def AddBuiltinOptionsType(builder, builtinOptionsType): builder.PrependUint8Slot(3, builtinOptionsType, 0) The provided code snippet includes necessary dependencies for implementing the `OperatorAddBuiltinOptionsType` function. Write a Python function `def...
This method is deprecated. Please switch to AddBuiltinOptionsType.
25,445
import flatbuffers from flatbuffers.compat import import_numpy def AddBuiltinOptions(builder, builtinOptions): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(builtinOptions), 0) The provided code snippet includes necessary dependencies for implementing the `OperatorAddBuiltinOpti...
This method is deprecated. Please switch to AddBuiltinOptions.
25,446
import flatbuffers from flatbuffers.compat import import_numpy def AddCustomOptions(builder, customOptions): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(customOptions), 0) The provided code snippet includes necessary dependencies for implementing the `OperatorAddCustomOptions`...
This method is deprecated. Please switch to AddCustomOptions.
25,447
import flatbuffers from flatbuffers.compat import import_numpy def StartCustomOptionsVector(builder, numElems): return builder.StartVector(1, numElems, 1) The provided code snippet includes necessary dependencies for implementing the `OperatorStartCustomOptionsVector` function. Write a Python function `def OperatorSta...
This method is deprecated. Please switch to Start.
25,448
import flatbuffers from flatbuffers.compat import import_numpy def AddCustomOptionsFormat(builder, customOptionsFormat): builder.PrependInt8Slot(6, customOptionsFormat, 0) The provided code snippet includes necessary dependencies for implementing the `OperatorAddCustomOptionsFormat` function. Write a Python function `...
This method is deprecated. Please switch to AddCustomOptionsFormat.
25,449
import flatbuffers from flatbuffers.compat import import_numpy def AddMutatingVariableInputs(builder, mutatingVariableInputs): builder.PrependUOffsetTRelativeSlot(7, flatbuffers.number_types.UOffsetTFlags.py_type(mutatingVariableInputs), 0) The provided code snippet includes necessary dependencies for implementing the...
This method is deprecated. Please switch to AddMutatingVariableInputs.
25,450
import flatbuffers from flatbuffers.compat import import_numpy def StartMutatingVariableInputsVector(builder, numElems): return builder.StartVector(1, numElems, 1) The provided code snippet includes necessary dependencies for implementing the `OperatorStartMutatingVariableInputsVector` function. Write a Python functio...
This method is deprecated. Please switch to Start.
25,451
import flatbuffers from flatbuffers.compat import import_numpy def AddIntermediates(builder, intermediates): builder.PrependUOffsetTRelativeSlot(8, flatbuffers.number_types.UOffsetTFlags.py_type(intermediates), 0) The provided code snippet includes necessary dependencies for implementing the `OperatorAddIntermediates`...
This method is deprecated. Please switch to AddIntermediates.
25,452
import flatbuffers from flatbuffers.compat import import_numpy def StartIntermediatesVector(builder, numElems): return builder.StartVector(4, numElems, 4) The provided code snippet includes necessary dependencies for implementing the `OperatorStartIntermediatesVector` function. Write a Python function `def OperatorSta...
This method is deprecated. Please switch to Start.
25,453
import flatbuffers from flatbuffers.compat import import_numpy def End(builder): return builder.EndObject() The provided code snippet includes necessary dependencies for implementing the `OperatorEnd` function. Write a Python function `def OperatorEnd(builder)` to solve the following problem: This method is deprecated...
This method is deprecated. Please switch to End.
25,454
import flatbuffers from flatbuffers.compat import import_numpy def Start(builder): builder.StartObject(0) The provided code snippet includes necessary dependencies for implementing the `ReadVariableOptionsStart` function. Write a Python function `def ReadVariableOptionsStart(builder)` to solve the following problem: T...
This method is deprecated. Please switch to Start.
25,455
import flatbuffers from flatbuffers.compat import import_numpy def End(builder): return builder.EndObject() The provided code snippet includes necessary dependencies for implementing the `ReadVariableOptionsEnd` function. Write a Python function `def ReadVariableOptionsEnd(builder)` to solve the following problem: Thi...
This method is deprecated. Please switch to End.
25,456
import flatbuffers from flatbuffers.compat import import_numpy def Start(builder): builder.StartObject(2) The provided code snippet includes necessary dependencies for implementing the `ReverseSequenceOptionsStart` function. Write a Python function `def ReverseSequenceOptionsStart(builder)` to solve the following prob...
This method is deprecated. Please switch to Start.
25,457
import flatbuffers from flatbuffers.compat import import_numpy def AddSeqDim(builder, seqDim): builder.PrependInt32Slot(0, seqDim, 0) The provided code snippet includes necessary dependencies for implementing the `ReverseSequenceOptionsAddSeqDim` function. Write a Python function `def ReverseSequenceOptionsAddSeqDim(b...
This method is deprecated. Please switch to AddSeqDim.
25,458
import flatbuffers from flatbuffers.compat import import_numpy def AddBatchDim(builder, batchDim): builder.PrependInt32Slot(1, batchDim, 0) The provided code snippet includes necessary dependencies for implementing the `ReverseSequenceOptionsAddBatchDim` function. Write a Python function `def ReverseSequenceOptionsAdd...
This method is deprecated. Please switch to AddBatchDim.
25,459
import flatbuffers from flatbuffers.compat import import_numpy def End(builder): return builder.EndObject() The provided code snippet includes necessary dependencies for implementing the `ReverseSequenceOptionsEnd` function. Write a Python function `def ReverseSequenceOptionsEnd(builder)` to solve the following proble...
This method is deprecated. Please switch to End.
25,460
from contextlib import contextmanager import logging as _logging from logging import * import os import types import tensorflow as tf from . import constants _logging.addLevelName(VERBOSE, "VERBOSE") def getLogger(name=None): # pylint: disable=invalid-name, function-redefined logger = _logging.getLogger(name) ...
Do basic configuration for the logging system. tf verbosity is updated accordingly.
25,461
from contextlib import contextmanager import logging as _logging from logging import * import os import types import tensorflow as tf from . import constants _LOG_LEVELS = [FATAL, ERROR, WARNING, INFO, VERBOSE, DEBUG] The provided code snippet includes necessary dependencies for implementing the `get_verbosity_level...
If verbosity is specified, return corresponding level, otherwise, return default_level.
25,462
from contextlib import contextmanager import logging as _logging from logging import * import os import types import tensorflow as tf from . import constants _logging.addLevelName(VERBOSE, "VERBOSE") def getLogger(name=None): # pylint: disable=invalid-name, function-redefined logger = _logging.getLogger(name) ...
Set logging level for tf2onnx package. tf verbosity is updated accordingly.
25,463
from contextlib import contextmanager import logging as _logging from logging import * import os import types import tensorflow as tf from . import constants def getLogger(name=None): # pylint: disable=invalid-name, function-redefined logger = _logging.getLogger(name) # Inject verbose method to logger object...
Set logging level to logger within context, reset level to previous value when exit context. TF verbosity is NOT affected.
25,464
from tf2onnx.graph_matcher import OpTypePattern, GraphMatcher class OpTypePattern(object): """A tree pattern that matches TF expressions with certain op types.""" def __init__(self, op_type, name=None, inputs=None, allow_reorder=None): """Initializes an OpTypePattern. Args: op_type:...
null
25,465
import numpy as np from tf2onnx.graph_matcher import OpTypePattern, GraphMatcher from tf2onnx import utils class OpTypePattern(object): """A tree pattern that matches TF expressions with certain op types.""" def __init__(self, op_type, name=None, inputs=None, allow_reorder=None): """Initializes an OpT...
null
25,466
import numpy as np from tf2onnx.graph_matcher import OpTypePattern, GraphMatcher def get_uniform_const_val(n): def get_out_and_offset(n): def node_is_one_plus_node(node, one_plus_node): class OpTypePattern(object): def __init__(self, op_type, name=None, inputs=None, allow_reorder=None): def op_type(self): ...
null
25,467
from tf2onnx.graph_matcher import OpTypePattern, GraphMatcher class OpTypePattern(object): def __init__(self, op_type, name=None, inputs=None, allow_reorder=None): def op_type(self): def inputs(self): def name(self): class GraphMatcher(object): def __init__(self, pattern, allow_reorder=Fal...
null
25,468
from tf2onnx import utils, constants def _to_channel_last_handler(g, op): def get_channels_first_ops(opset=None): def rewrite_channels_last(g, ops): channel_first_ops = get_channels_first_ops(g.opset) for op in ops: if op.type in channel_first_ops: _to_channel_last_handler(g, op) return...
null
25,469
from tf2onnx import utils, constants def _to_channel_first_handler(g, op): rank = g.get_rank(op.output[0]) utils.make_sure(rank is not None, "Cannot convert %s node %s with unknown rank to channels last", op.type, op.name) op.type = op.type.replace("ChannelsLast", "") op.domain = constants.ONNX_DOMAIN ...
null
25,470
import numpy as np from onnx import onnx_pb from onnx.onnx_pb import TensorProto from tf2onnx import constants, utils from tf2onnx.handler import tf_op from tf2onnx.onnx_opset import controlflow from tf2onnx.onnx_opset.nn import conv_convert_inputs, conv_dims_attr def _make_range_non_const(ctx, start, limit, delta, out...
null
25,471
import logging import uuid from packaging.version import Version import tensorflow as tf import numpy as np from google.protobuf.message import DecodeError from tensorflow.core.framework import tensor_pb2 from tensorflow.core.protobuf import saved_model_pb2 from tensorflow.python.ops import lookup_ops from tensorflow.p...
Load tensorflow graph from graphdef.
25,472
import logging import uuid from packaging.version import Version import tensorflow as tf import numpy as np from google.protobuf.message import DecodeError from tensorflow.core.framework import tensor_pb2 from tensorflow.core.protobuf import saved_model_pb2 from tensorflow.python.ops import lookup_ops from tensorflow.p...
Load tensorflow graph from checkpoint.
25,473
import logging import uuid from packaging.version import Version import tensorflow as tf import numpy as np from google.protobuf.message import DecodeError from tensorflow.core.framework import tensor_pb2 from tensorflow.core.protobuf import saved_model_pb2 from tensorflow.python.ops import lookup_ops from tensorflow.p...
Load tensorflow graph from saved_model.
25,474
import collections import importlib import logging import struct from onnx import helper, onnx_pb, numpy_helper from tensorflow.core.framework import types_pb2, tensor_pb2, node_def_pb2 from tensorflow.python.framework import tensor_util import tensorflow as tf import numpy as np from tf2onnx.tflite.TensorType import T...
null
25,475
import argparse import collections import re import onnx from onnx import ModelProto from onnx import helper, shape_inference def get_args(): parser = argparse.ArgumentParser() parser.add_argument("--input", required=True, help="input model") parser.add_argument("--pbtxt", help="write pbtxt") parser.ad...
null
25,476
import argparse from collections import Counter import tensorflow as tf def get_args(): parser = argparse.ArgumentParser() parser.add_argument("--input", required=True, help="input model") return parser.parse_args()
null
25,477
import argparse from collections import Counter import tensorflow as tf The provided code snippet includes necessary dependencies for implementing the `cleanup_io_name` function. Write a Python function `def cleanup_io_name(name)` to solve the following problem: Cleanup op names. Here is the function: def cleanup_io...
Cleanup op names.
25,478
import argparse from collections import Counter import logging import os import sys import copy from google.protobuf import text_format import tensorflow as tf from tensorflow.python.framework import graph_util from tensorflow.core.framework import attr_value_pb2, graph_pb2, node_def_pb2 def get_file_name(path): def g...
null
25,479
import argparse from collections import Counter import logging import os import sys import copy from google.protobuf import text_format import tensorflow as tf from tensorflow.python.framework import graph_util from tensorflow.core.framework import attr_value_pb2, graph_pb2, node_def_pb2 def replace_file_extension(pat...
null
25,480
import argparse from collections import Counter import logging import os import sys import copy from google.protobuf import text_format import tensorflow as tf from tensorflow.python.framework import graph_util from tensorflow.core.framework import attr_value_pb2, graph_pb2, node_def_pb2 def append_file_name_suffix(pa...
null
25,481
import argparse from collections import Counter import logging import os import sys import copy from google.protobuf import text_format import tensorflow as tf from tensorflow.python.framework import graph_util from tensorflow.core.framework import attr_value_pb2, graph_pb2, node_def_pb2 def get_file_directory(path): ...
null
25,482
import argparse from collections import Counter import logging import os import sys import copy from google.protobuf import text_format import tensorflow as tf from tensorflow.python.framework import graph_util from tensorflow.core.framework import attr_value_pb2, graph_pb2, node_def_pb2 def create_directory(path): ...
null
25,483
import argparse from collections import Counter import logging import os import sys import copy from google.protobuf import text_format import tensorflow as tf from tensorflow.python.framework import graph_util from tensorflow.core.framework import attr_value_pb2, graph_pb2, node_def_pb2 def load_graph_def_from_pb(pat...
null
25,484
import argparse from collections import Counter import logging import os import sys import copy from google.protobuf import text_format import tensorflow as tf from tensorflow.python.framework import graph_util from tensorflow.core.framework import attr_value_pb2, graph_pb2, node_def_pb2 def save_graph_def(graph_def, ...
null
25,485
import argparse from collections import Counter import logging import os import sys import copy from google.protobuf import text_format import tensorflow as tf from tensorflow.python.framework import graph_util from tensorflow.core.framework import attr_value_pb2, graph_pb2, node_def_pb2 def get_node_name(tensor_name):...
null
25,486
import sys import cProfile from pstats import SortKey, Stats import io import argparse import tensorflow as tf from tensorflow.keras.applications import MobileNet, EfficientNetB2 from tf2onnx import tfonnx def create(name): "Creates the model." graph_def, model = spy_model(name) return graph_def, model def ...
Profiles the conversion of a model. :param profiler: one among none, spy, pyinstrument, cProfile :param name: model to profile, MobileNet, EfficientNetB2 :param showall: used by pyinstrument to show all functions
25,487
import argparse import collections import csv import os from onnx import ModelProto def parse_onnx(fname): def one_file(fname, summary, max_nodes): g = parse_onnx(fname) for output_node in g.outputs: res = g.bfs([output_node]) for node in res: ret = node.walk(max_nodes) ...
null
25,488
import argparse import collections import csv import os from onnx import ModelProto def read_csv(fname, summary): with open(fname, "r", encoding="utf-8") as fp: rd = csv.reader(fp) next(rd) for row in rd: if len(row) > 4: summary[row[4]] = int(row[1])
null
25,489
import argparse import collections import csv import os from onnx import ModelProto def get_args(): parser = argparse.ArgumentParser() parser.add_argument("--output", help="write to csv") parser.add_argument("--summary", help="write combined to csv") parser.add_argument("--fold", action="store_true", h...
null
25,490
import argparse import inspect import re from collections import OrderedDict from tf2onnx.handler import tf_op def is_unsupported(func_body): source_code = inspect.getsource(func_body) if re.findall(r'raise NotImplementedError', source_code): return True return False
null
25,491
import argparse import logging import traceback import numpy as np import onnx import tf2onnx.utils from tf2onnx.graph import GraphUtil The provided code snippet includes necessary dependencies for implementing the `get_args` function. Write a Python function `def get_args()` to solve the following problem: Parse comm...
Parse commandline.
25,492
import argparse import logging import traceback import numpy as np import onnx import tf2onnx.utils from tf2onnx.graph import GraphUtil class GraphUtil(object): def optimize_graph(graph, catch_errors=True, optimizers=None): def optimize_model_proto(onnx_model_proto, catch_errors=True, return_graph=False, ...
null
25,493
import argparse import logging import traceback import numpy as np import onnx import tf2onnx.utils from tf2onnx.graph import GraphUtil def sample_rewrite(g, ops): return ops
null
25,494
import argparse import logging import traceback import numpy as np import onnx import tf2onnx.utils from tf2onnx.graph import GraphUtil logger = logging.getLogger("onnx-experiments") def rewrite_constant_fold(g, ops): func_map = { "Transpose": not None, "Unsqueeze": not None, "Slice": not ...
null
25,495
import argparse import os import tensorflow as tf def get_args(): parser = argparse.ArgumentParser() parser.add_argument("infile", nargs="*", help="event files") args = parser.parse_args() return args
null
25,496
import argparse import os import tensorflow as tf The provided code snippet includes necessary dependencies for implementing the `to_pb` function. Write a Python function `def to_pb(src)` to solve the following problem: Convert .meta to .pb. Here is the function: def to_pb(src): """Convert .meta to .pb.""" _...
Convert .meta to .pb.
25,497
import argparse import logging import onnx from onnx import helper from tf2onnx.graph import GraphUtil from tf2onnx import logging, optimizer, constants from tf2onnx.late_rewriters import rewrite_channels_first, rewrite_channels_last The provided code snippet includes necessary dependencies for implementing the `get_a...
Parse commandline.
25,498
import argparse import logging import onnx from onnx import helper from tf2onnx.graph import GraphUtil from tf2onnx import logging, optimizer, constants from tf2onnx.late_rewriters import rewrite_channels_first, rewrite_channels_last class GraphUtil(object): """Utilities for Graph manipulation.""" def optimiz...
null