id int64 0 190k | prompt stringlengths 21 13.4M | docstring stringlengths 1 12k ⌀ |
|---|---|---|
24,899 | import logging
import copy
from collections import defaultdict, OrderedDict
from onnx import defs, helper, TensorProto, OperatorSetIdProto, shape_inference
from . import constants
from . import utils
_schemas = _register_all_schemas_with_history()
The provided code snippet includes necessary dependencies for implement... | Get schema by name within specific version. |
24,900 | import logging
import copy
from collections import defaultdict, OrderedDict
from onnx import defs, helper, TensorProto, OperatorSetIdProto, shape_inference
from . import constants
from . import utils
logger = logging.getLogger(__name__)
The provided code snippet includes necessary dependencies for implementing the `in... | Infer shapes and dtypes for outputs of the node. Sometimes, shape inference needs the values of node's inputs, so initializers are used. |
24,901 | import argparse
import os
import sys
from packaging.version import Version
import tensorflow as tf
from tf2onnx.tfonnx import process_tf_graph
from tf2onnx import constants, logging, utils, optimizer
from tf2onnx import tf_loader
from tf2onnx.graph import ExternalTensorStorage
from tf2onnx.tf_utils import compress_grap... | Parse commandline. |
24,902 | import argparse
import os
import sys
from packaging.version import Version
import tensorflow as tf
from tf2onnx.tfonnx import process_tf_graph
from tf2onnx import constants, logging, utils, optimizer
from tf2onnx import tf_loader
from tf2onnx.graph import ExternalTensorStorage
from tf2onnx.tf_utils import compress_grap... | Returns a ONNX model_proto for a tf.keras model. Args: model: the tf.keras model we want to convert input_signature: a tf.TensorSpec or a numpy array defining the shape/dtype of the input opset: the opset to be used for the ONNX model, default is the latest custom_ops: if a model contains ops not recognized by onnx run... |
24,903 | import argparse
import os
import sys
from packaging.version import Version
import tensorflow as tf
from tf2onnx.tfonnx import process_tf_graph
from tf2onnx import constants, logging, utils, optimizer
from tf2onnx import tf_loader
from tf2onnx.graph import ExternalTensorStorage
from tf2onnx.tf_utils import compress_grap... | Returns a ONNX model_proto for a tf.function. Args: function: the tf.function we want to convert input_signature: a tf.TensorSpec or a numpy array defining the shape/dtype of the input opset: the opset to be used for the ONNX model, default is the latest custom_ops: if a model contains ops not recognized by onnx runtim... |
24,904 | import argparse
import os
import sys
from packaging.version import Version
import tensorflow as tf
from tf2onnx.tfonnx import process_tf_graph
from tf2onnx import constants, logging, utils, optimizer
from tf2onnx import tf_loader
from tf2onnx.graph import ExternalTensorStorage
from tf2onnx.tf_utils import compress_grap... | Returns a ONNX model_proto for a tensorflow graphdef. Args: graph_def: the graphdef we want to convert input_names: list of input names output_names: list of output names name: A name for the graph opset: the opset to be used for the ONNX model, default is the latest custom_ops: if a model contains ops not recognized b... |
24,905 | import argparse
import os
import sys
from packaging.version import Version
os.environ['TF_CPP_MIN_LOG_LEVEL'] = "3"
import tensorflow as tf
from tf2onnx.tfonnx import process_tf_graph
from tf2onnx import constants, logging, utils, optimizer
from tf2onnx import tf_loader
from tf2onnx.graph import ExternalTensorStorage
f... | Returns a ONNX model_proto for a tflite model file. Args: tflite_path: the tflite model file full path input_names: list of input names output_names: list of output names opset: the opset to be used for the ONNX model, default is the latest custom_ops: if a model contains ops not recognized by onnx runtime, you can tag... |
24,906 | import copy
import numpy as np
from onnx.onnx_pb import TensorProto
from tf2onnx.handler import tfl_op
from tf2onnx import utils
from tf2onnx.tf_loader import find_function
from tf2onnx.graph_builder import GraphBuilder
from tf2onnx.onnx_opset.controlflow import parameter_binding, inline_subgraph
def inline_subgraph(p... | Wire subgraph graph into main. |
24,907 | import logging
import numpy as np
from onnx.onnx_pb import TensorProto
from tf2onnx.handler import tfl_op
from tf2onnx import utils
def separate_fused_activation_function(ctx, node):
activation_fn = node.attr['fused_activation_function'].s
del node.attr['fused_activation_function']
if activation_fn == b'RE... | null |
24,908 | import logging
import numpy as np
from onnx.onnx_pb import TensorProto
from tf2onnx.handler import tfl_op
from tf2onnx import utils
logger = logging.getLogger(__name__)
def dynamic_quantize_inputs(ctx, node):
if ctx.opset < 11:
logger.warning("Opset 11 is required for asymmetric_quantize_inputs of node %s"... | null |
24,909 | from collections import defaultdict
import numpy as np
import onnx
from tf2onnx.constants import NCHW_TO_NHWC, NHWC_TO_NCHW, NCDHW_TO_NDHWC, NDHWC_TO_NCDHW, TARGET_CHANNELS_LAST
from .. import utils
from .optimizer_base import GraphOptimizerBase
def is_transpose(transpose_node):
perm_attr = transpose_node.get_attr... | null |
24,910 | from collections import defaultdict
import numpy as np
import onnx
from tf2onnx.constants import NCHW_TO_NHWC, NHWC_TO_NCHW, NCDHW_TO_NDHWC, NDHWC_TO_NCDHW, TARGET_CHANNELS_LAST
from .. import utils
from .optimizer_base import GraphOptimizerBase
def is_tranpose_of_type(node, perm):
perm_attr = node.get_attr('perm'... | null |
24,911 | from collections import defaultdict
import numpy as np
import onnx
from tf2onnx.constants import NCHW_TO_NHWC, NHWC_TO_NCHW, NCDHW_TO_NDHWC, NDHWC_TO_NCDHW, TARGET_CHANNELS_LAST
from .. import utils
from .optimizer_base import GraphOptimizerBase
def is_useless_transpose(transpose_node):
perm_attr = transpose_node.... | null |
24,912 | from collections import defaultdict
import numpy as np
import onnx
from tf2onnx.constants import NCHW_TO_NHWC, NHWC_TO_NCHW, NCDHW_TO_NDHWC, NDHWC_TO_NCDHW, TARGET_CHANNELS_LAST
from .. import utils
from .optimizer_base import GraphOptimizerBase
def get_transpose_rank(trans):
return len(trans.get_attr('perm').ints... | null |
24,913 | from collections import defaultdict
import numpy as np
import onnx
from tf2onnx.constants import NCHW_TO_NHWC, NHWC_TO_NCHW, NCDHW_TO_NDHWC, NDHWC_TO_NCDHW, TARGET_CHANNELS_LAST
from .. import utils
from .optimizer_base import GraphOptimizerBase
def invert_perm(perm):
inv = [0] * len(perm)
for i, p in enumerat... | null |
24,914 | from .optimizer_base import GraphOptimizerBase
The provided code snippet includes necessary dependencies for implementing the `is_tensor_op` function. Write a Python function `def is_tensor_op(g, node)` to solve the following problem:
Detects ops that reshape/shuffle tensor elements without computing/changing them (Tr... | Detects ops that reshape/shuffle tensor elements without computing/changing them (Transpose, Gather, etc.) Returns None or a tuple (inp_indices, out_indices) s.t. all corresponding outputs of the node depend only on elements of the corresponding inputs of the node and all other inputs/outputs are unchanged. WARNING: Tr... |
24,915 | import numpy as np
from .. import utils
from .optimizer_base import GraphOptimizerBase
_func_map = {}
def _register_func(op_type):
def _internal_fun(func):
_func_map[op_type] = func
return func
return _internal_fun | null |
24,916 | import math
from itertools import permutations
import numpy as np
from onnx import helper, numpy_helper, TensorProto, AttributeProto
from .. import utils
from ..constants import OPSET_TO_IR_VERSION, PREFERRED_OPSET
from .optimizer_base import GraphOptimizerBase
The provided code snippet includes necessary dependencies... | *axes* contains positive values, then it is the position of this axis in the original matrix, otherwise it is -1 meaning this axis is an added single dimension to align all the dimensions based on the einsum equation. :param axes: axes described above :return: list of integer in set `{1, 2}`, 1 for a single axis, 2 oth... |
24,917 | import math
from itertools import permutations
import numpy as np
from onnx import helper, numpy_helper, TensorProto, AttributeProto
from .. import utils
from ..constants import OPSET_TO_IR_VERSION, PREFERRED_OPSET
from .optimizer_base import GraphOptimizerBase
class EinsumSubOp:
"""
Defines a sub operation use... | Decomposes an equation used in `numpy.einsum` knowing the input shapes. It returns a sequence of operations to do to compute the results. :param equation: a string :param shapes: sequence of input shapes :return: instance of class *GraphEinsumSubOp* Available operations: *expand_dims*, *transpose*, *matmul*, *reduce_su... |
24,918 | import math
from itertools import permutations
import numpy as np
from onnx import helper, numpy_helper, TensorProto, AttributeProto
from .. import utils
from ..constants import OPSET_TO_IR_VERSION, PREFERRED_OPSET
from .optimizer_base import GraphOptimizerBase
_ml_transpose_coefs = {
'CST_': 0.4720163707200312,
... | Given a shape and a permutation, predicts the cost of the transposition. :param shape: shape :param perm: permutation :param coefs: trained coefficients or None to get the default ones :return: dictionary of features |
24,919 | import math
from itertools import permutations
import numpy as np
from onnx import helper, numpy_helper, TensorProto, AttributeProto
from .. import utils
from ..constants import OPSET_TO_IR_VERSION, PREFERRED_OPSET
from .optimizer_base import GraphOptimizerBase
class CachedEinsum:
"""
Stores all the necessary i... | This function returns an instance of CachedEinsum. It has an attribute `equation_` which holds a new equation equal to the first one but with permutated letter. This new equation has a smaller computation time when executed with onnxruntime (optimized on the machine CPU). Attribute `equation_` returns an optimized equa... |
24,920 | import numpy as np
from tf2onnx.utils import ONNX_DTYPE_NAMES
from .optimizer_base import GraphOptimizerBase
_func_map = {}
def _register_func(op_type):
if not isinstance(op_type, tuple):
op_type = (op_type,)
def _internal_fun(func):
_func_map[op_type] = func
return func
return _... | null |
24,921 | from onnx import mapping, defs
import tensorflow as tf
import tf2onnx
from tf2onnx.constants import OPSET_TO_IR_VERSION
def _process_initial_types(initial_types, unknown_dim=1):
if initial_types is None:
return None
input_specs = []
c_ = 0
while c_ < len(initial_types):
name = None
... | :param model: keras model :param name: the converted onnx model internal name :param doc_string: doc string :param target_opset: the targeted onnx model opset :param initial_types: the overridden input type for the target ONNX model. :param channel_first_inputs: A list of channel first input :param debug_mode: ignored ... |
24,922 | import numpy as np
from tf2onnx.graph_matcher import OpTypePattern, GraphMatcher
from tf2onnx.graph_builder import GraphBuilder
from tf2onnx import utils, handler
def create_onnx_random_uniform_op(g, tmax, tmin, ru_op, output, to_delete):
dtype = g.get_dtype(output.output[0])
op_name = utils.make_name("RandomUn... | null |
24,923 | import numpy as np
from tf2onnx.graph_matcher import OpTypePattern, GraphMatcher
from tf2onnx.graph_builder import GraphBuilder
from tf2onnx import utils, handler
def create_onnx_random_uniform_op(g, tmax, tmin, ru_op, output, to_delete):
class OpTypePattern(object):
def __init__(self, op_type, name=None, inputs=... | null |
24,924 | import numpy as np
from tf2onnx import handler, logging
from tf2onnx.graph_matcher import OpTypePattern, GraphMatcher
logger = logging.getLogger(__name__)
class OpTypePattern(object):
"""A tree pattern that matches TF expressions with certain op types."""
def __init__(self, op_type, name=None, inputs=None, al... | null |
24,925 | import logging
from onnx import onnx_pb
from tf2onnx.graph_matcher import OpTypePattern, GraphMatcher
def get_gemm_attr(match):
attr = {}
for arg in ["alpha", "beta"]:
arg_op = match.get_op(arg)
if arg_op is not None:
match_args = arg_op.get_tensor_value()
if isinstance(m... | null |
24,926 | import numpy as np
from tf2onnx.graph_matcher import GraphMatcher
from tf2onnx.rewriter.rnn_utils import make_lstm_pattern
from tf2onnx.tf_loader import find_function
from tf2onnx.rewriter.lstm_rewriter_base import LSTMContext
from tf2onnx.rewriter.lstm_rewriter import LSTMRewriter
from tf2onnx.graph_builder import Gra... | null |
24,927 | from tf2onnx.graph_matcher import GraphMatcher
from tf2onnx.rewriter.rnn_utils import make_grucell_pattern, keras_gru_pattern
from tf2onnx.tf_loader import find_function
from tf2onnx.rewriter.unit_rnn_rewriter_base import UnitRnnContext
from tf2onnx.rewriter.gru_rewriter import GRUUnitRewriter
from tf2onnx.graph_builde... | null |
24,928 | 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 |
24,929 | import numpy as np
from tf2onnx import utils
from tf2onnx.graph_matcher import OpTypePattern, GraphMatcher
from tf2onnx import logging
logger = logging.getLogger(__name__)
class OpTypePattern(object):
"""A tree pattern that matches TF expressions with certain op types."""
def __init__(self, op_type, name=None... | null |
24,930 | 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 |
24,931 | 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 |
24,932 | import logging
from tf2onnx.rewriter.bilstm_rewriter import rewrite_bidirectional_lstms
from tf2onnx.rewriter.bigru_rewriter import rewrite_bidirectional_grus
from tf2onnx.rewriter.custom_rnn_rewriter import CustomRnnRewriter
from tf2onnx.rewriter.loop_rewriter import LoopRewriter
from tf2onnx.rewriter.lstm_rewriter im... | null |
24,933 | import logging
from tf2onnx.rewriter.bilstm_rewriter import rewrite_bidirectional_lstms
from tf2onnx.rewriter.bigru_rewriter import rewrite_bidirectional_grus
from tf2onnx.rewriter.custom_rnn_rewriter import CustomRnnRewriter
from tf2onnx.rewriter.loop_rewriter import LoopRewriter
from tf2onnx.rewriter.lstm_rewriter im... | null |
24,934 | import logging
from tf2onnx.rewriter.bilstm_rewriter import rewrite_bidirectional_lstms
from tf2onnx.rewriter.bigru_rewriter import rewrite_bidirectional_grus
from tf2onnx.rewriter.custom_rnn_rewriter import CustomRnnRewriter
from tf2onnx.rewriter.loop_rewriter import LoopRewriter
from tf2onnx.rewriter.lstm_rewriter im... | null |
24,935 | import logging
from tf2onnx.rewriter.bilstm_rewriter import rewrite_bidirectional_lstms
from tf2onnx.rewriter.bigru_rewriter import rewrite_bidirectional_grus
from tf2onnx.rewriter.custom_rnn_rewriter import CustomRnnRewriter
from tf2onnx.rewriter.loop_rewriter import LoopRewriter
from tf2onnx.rewriter.lstm_rewriter im... | null |
24,936 | import logging
from tf2onnx.rewriter.bilstm_rewriter import rewrite_bidirectional_lstms
from tf2onnx.rewriter.bigru_rewriter import rewrite_bidirectional_grus
from tf2onnx.rewriter.custom_rnn_rewriter import CustomRnnRewriter
from tf2onnx.rewriter.loop_rewriter import LoopRewriter
from tf2onnx.rewriter.lstm_rewriter im... | null |
24,937 | import logging
from tf2onnx.rewriter.bilstm_rewriter import rewrite_bidirectional_lstms
from tf2onnx.rewriter.bigru_rewriter import rewrite_bidirectional_grus
from tf2onnx.rewriter.custom_rnn_rewriter import CustomRnnRewriter
from tf2onnx.rewriter.loop_rewriter import LoopRewriter
from tf2onnx.rewriter.lstm_rewriter im... | null |
24,938 | from tf2onnx import logging
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.
... | null |
24,939 | from onnx import TensorProto, helper
from tf2onnx.graph_matcher import OpTypePattern, GraphMatcher
from tf2onnx.graph_builder import GraphBuilder
class OpTypePattern(object):
"""A tree pattern that matches TF expressions with certain op types."""
def __init__(self, op_type, name=None, inputs=None, allow_reord... | null |
24,940 | import numpy as np
from tf2onnx.graph_matcher import OpTypePattern, GraphMatcher
def determine_pad_mode(paddings_inp_node):
tensor_ops = set(["Concat", "ConcatV2", "ConcatV3", "StridedSlice", "Pack", "ExpandDims", "Identity"])
while paddings_inp_node.type in tensor_ops:
non_const = [inp for inp in paddi... | null |
24,941 | import logging
import traceback
from collections import OrderedDict
from enum import Enum
from tf2onnx import utils
class CondRewriter:
def __init__(self, g):
self.g = g
def rewrite(self):
logger.debug("enter cond pre rewrite")
return self.run()
def run(self):
"""tf.cond rewr... | null |
24,942 | from collections import defaultdict
from enum import Enum
import logging
import numpy as np
from tf2onnx import utils
from tf2onnx.graph_builder import GraphBuilder
from tf2onnx.graph_matcher import OpTypePattern
class OpTypePattern(object):
def __init__(self, op_type, name=None, inputs=None, allow_reorder=None):... | null |
24,943 | from collections import defaultdict
from enum import Enum
import logging
import numpy as np
from tf2onnx import utils
from tf2onnx.graph_builder import GraphBuilder
from tf2onnx.graph_matcher import OpTypePattern
rnn_cell_patterns = {
RNNUnitType.LSTMCell: [lstmcell_pattern, lstmcell_pattern_optimized],
RNNUnit... | null |
24,944 | from collections import defaultdict
from enum import Enum
import logging
import numpy as np
from tf2onnx import utils
from tf2onnx.graph_builder import GraphBuilder
from tf2onnx.graph_matcher import OpTypePattern
def get_rnn_scope_name(while_scope_name):
parts = while_scope_name.split('/')
rnn_scope = '/'.join... | null |
24,945 | from collections import defaultdict
from enum import Enum
import logging
import numpy as np
from tf2onnx import utils
from tf2onnx.graph_builder import GraphBuilder
from tf2onnx.graph_matcher import OpTypePattern
logger = logging.getLogger(__name__)
class TensorArrayVariableType:
GATHER_ALL = "GATHER_ALL"
READ... | check if the while loop is generated by dynamic_rnn or bidirectional_rnn Args: loop_properties: LoopProperties rnn_scope: rnn scope name while_context_scope: while loop scope name check a while loop is generated by dynamic_rnn or bidirectional_rnn by 1. some patterns in _time_step in dynamic_rnn: tensor array read, ten... |
24,946 | from collections import defaultdict
from enum import Enum
import logging
import numpy as np
from tf2onnx import utils
from tf2onnx.graph_builder import GraphBuilder
from tf2onnx.graph_matcher import OpTypePattern
logger = logging.getLogger(__name__)
def get_weights_from_const_node(g, node):
temp = node
val = N... | null |
24,947 | from onnx import onnx_pb
from tf2onnx.graph_builder import GraphBuilder
from tf2onnx.graph_matcher import OpTypePattern, GraphMatcher
class GraphBuilder(object):
"""help to build graph"""
def __init__(self, graph):
self._g = graph
def graph(self):
return self._g
def make_slice(self, k... | null |
24,948 | from tf2onnx import utils
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.
... | null |
24,949 | import numpy as np
from tf2onnx import utils
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 OpT... | null |
24,950 |
def rewrite_fused_ops(g, ops):
for node in ops:
if node.type in ["_FusedConv2D", "_FusedMatMul", "_FusedDepthwiseConv2dNative"]:
op_types = [op.decode() for op in node.get_attr_value("fused_ops")]
extra_inputs = node.input[2:]
g.replace_inputs(node, node.input[:2])
... | null |
24,951 | import numpy as np
from tf2onnx import utils
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):
... | null |
24,952 | import numpy as np
from onnx import TensorProto, helper
from tf2onnx.graph_matcher import OpTypePattern, GraphMatcher
from tf2onnx import utils
def create_qdq_nodes(g, match_results):
for match in match_results:
qdq_node = match.get_op('output')
qdq_node_output_dtype = g.get_dtype(qdq_node.output[0]... | null |
24,953 | import flatbuffers
from flatbuffers.compat import import_numpy
def Start(builder): builder.StartObject(1)
The provided code snippet includes necessary dependencies for implementing the `DivOptionsStart` function. Write a Python function `def DivOptionsStart(builder)` to solve the following problem:
This method is depr... | This method is deprecated. Please switch to Start. |
24,954 | import flatbuffers
from flatbuffers.compat import import_numpy
def AddFusedActivationFunction(builder, fusedActivationFunction): builder.PrependInt8Slot(0, fusedActivationFunction, 0)
The provided code snippet includes necessary dependencies for implementing the `DivOptionsAddFusedActivationFunction` function. Write a... | This method is deprecated. Please switch to AddFusedActivationFunction. |
24,955 | import flatbuffers
from flatbuffers.compat import import_numpy
def End(builder): return builder.EndObject()
The provided code snippet includes necessary dependencies for implementing the `DivOptionsEnd` function. Write a Python function `def DivOptionsEnd(builder)` to solve the following problem:
This method is deprec... | This method is deprecated. Please switch to End. |
24,956 | import flatbuffers
from flatbuffers.compat import import_numpy
def Start(builder): builder.StartObject(0)
The provided code snippet includes necessary dependencies for implementing the `DensifyOptionsStart` function. Write a Python function `def DensifyOptionsStart(builder)` to solve the following problem:
This method... | This method is deprecated. Please switch to Start. |
24,957 | import flatbuffers
from flatbuffers.compat import import_numpy
def End(builder): return builder.EndObject()
The provided code snippet includes necessary dependencies for implementing the `DensifyOptionsEnd` function. Write a Python function `def DensifyOptionsEnd(builder)` to solve the following problem:
This method i... | This method is deprecated. Please switch to End. |
24,958 | import flatbuffers
from flatbuffers.compat import import_numpy
def Start(builder): builder.StartObject(5)
The provided code snippet includes necessary dependencies for implementing the `StridedSliceOptionsStart` function. Write a Python function `def StridedSliceOptionsStart(builder)` to solve the following problem:
T... | This method is deprecated. Please switch to Start. |
24,959 | import flatbuffers
from flatbuffers.compat import import_numpy
def AddBeginMask(builder, beginMask): builder.PrependInt32Slot(0, beginMask, 0)
The provided code snippet includes necessary dependencies for implementing the `StridedSliceOptionsAddBeginMask` function. Write a Python function `def StridedSliceOptionsAddBe... | This method is deprecated. Please switch to AddBeginMask. |
24,960 | import flatbuffers
from flatbuffers.compat import import_numpy
def AddEndMask(builder, endMask): builder.PrependInt32Slot(1, endMask, 0)
The provided code snippet includes necessary dependencies for implementing the `StridedSliceOptionsAddEndMask` function. Write a Python function `def StridedSliceOptionsAddEndMask(bu... | This method is deprecated. Please switch to AddEndMask. |
24,961 | import flatbuffers
from flatbuffers.compat import import_numpy
def AddEllipsisMask(builder, ellipsisMask): builder.PrependInt32Slot(2, ellipsisMask, 0)
The provided code snippet includes necessary dependencies for implementing the `StridedSliceOptionsAddEllipsisMask` function. Write a Python function `def StridedSlice... | This method is deprecated. Please switch to AddEllipsisMask. |
24,962 | import flatbuffers
from flatbuffers.compat import import_numpy
def AddNewAxisMask(builder, newAxisMask): builder.PrependInt32Slot(3, newAxisMask, 0)
The provided code snippet includes necessary dependencies for implementing the `StridedSliceOptionsAddNewAxisMask` function. Write a Python function `def StridedSliceOpti... | This method is deprecated. Please switch to AddNewAxisMask. |
24,963 | import flatbuffers
from flatbuffers.compat import import_numpy
def AddShrinkAxisMask(builder, shrinkAxisMask): builder.PrependInt32Slot(4, shrinkAxisMask, 0)
The provided code snippet includes necessary dependencies for implementing the `StridedSliceOptionsAddShrinkAxisMask` function. Write a Python function `def Stri... | This method is deprecated. Please switch to AddShrinkAxisMask. |
24,964 | import flatbuffers
from flatbuffers.compat import import_numpy
def End(builder): return builder.EndObject()
The provided code snippet includes necessary dependencies for implementing the `StridedSliceOptionsEnd` function. Write a Python function `def StridedSliceOptionsEnd(builder)` to solve the following problem:
Thi... | This method is deprecated. Please switch to End. |
24,965 | import flatbuffers
from flatbuffers.compat import import_numpy
def Start(builder): builder.StartObject(0)
The provided code snippet includes necessary dependencies for implementing the `SelectOptionsStart` function. Write a Python function `def SelectOptionsStart(builder)` to solve the following problem:
This method i... | This method is deprecated. Please switch to Start. |
24,966 | import flatbuffers
from flatbuffers.compat import import_numpy
def End(builder): return builder.EndObject()
The provided code snippet includes necessary dependencies for implementing the `SelectOptionsEnd` function. Write a Python function `def SelectOptionsEnd(builder)` to solve the following problem:
This method is ... | This method is deprecated. Please switch to End. |
24,967 | import flatbuffers
from flatbuffers.compat import import_numpy
def Start(builder): builder.StartObject(0)
The provided code snippet includes necessary dependencies for implementing the `AbsOptionsStart` function. Write a Python function `def AbsOptionsStart(builder)` to solve the following problem:
This method is depr... | This method is deprecated. Please switch to Start. |
24,968 | import flatbuffers
from flatbuffers.compat import import_numpy
def End(builder): return builder.EndObject()
The provided code snippet includes necessary dependencies for implementing the `AbsOptionsEnd` function. Write a Python function `def AbsOptionsEnd(builder)` to solve the following problem:
This method is deprec... | This method is deprecated. Please switch to End. |
24,969 | import flatbuffers
from flatbuffers.compat import import_numpy
def Start(builder): builder.StartObject(0)
The provided code snippet includes necessary dependencies for implementing the `ReverseV2OptionsStart` function. Write a Python function `def ReverseV2OptionsStart(builder)` to solve the following problem:
This me... | This method is deprecated. Please switch to Start. |
24,970 | import flatbuffers
from flatbuffers.compat import import_numpy
def End(builder): return builder.EndObject()
The provided code snippet includes necessary dependencies for implementing the `ReverseV2OptionsEnd` function. Write a Python function `def ReverseV2OptionsEnd(builder)` to solve the following problem:
This meth... | This method is deprecated. Please switch to End. |
24,971 | import flatbuffers
from flatbuffers.compat import import_numpy
def Start(builder): builder.StartObject(1)
The provided code snippet includes necessary dependencies for implementing the `BufferStart` function. Write a Python function `def BufferStart(builder)` to solve the following problem:
This method is deprecated. ... | This method is deprecated. Please switch to Start. |
24,972 | import flatbuffers
from flatbuffers.compat import import_numpy
def AddData(builder, data): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(data), 0)
The provided code snippet includes necessary dependencies for implementing the `BufferAddData` function. Write a Python function `de... | This method is deprecated. Please switch to AddData. |
24,973 | import flatbuffers
from flatbuffers.compat import import_numpy
def StartDataVector(builder, numElems): return builder.StartVector(1, numElems, 1)
The provided code snippet includes necessary dependencies for implementing the `BufferStartDataVector` function. Write a Python function `def BufferStartDataVector(builder, ... | This method is deprecated. Please switch to Start. |
24,974 | import flatbuffers
from flatbuffers.compat import import_numpy
def End(builder): return builder.EndObject()
The provided code snippet includes necessary dependencies for implementing the `BufferEnd` function. Write a Python function `def BufferEnd(builder)` to solve the following problem:
This method is deprecated. Pl... | This method is deprecated. Please switch to End. |
24,975 | import flatbuffers
from flatbuffers.compat import import_numpy
def Start(builder): builder.StartObject(4)
The provided code snippet includes necessary dependencies for implementing the `BidirectionalSequenceRNNOptionsStart` function. Write a Python function `def BidirectionalSequenceRNNOptionsStart(builder)` to solve ... | This method is deprecated. Please switch to Start. |
24,976 | import flatbuffers
from flatbuffers.compat import import_numpy
def AddTimeMajor(builder, timeMajor): builder.PrependBoolSlot(0, timeMajor, 0)
The provided code snippet includes necessary dependencies for implementing the `BidirectionalSequenceRNNOptionsAddTimeMajor` function. Write a Python function `def Bidirectional... | This method is deprecated. Please switch to AddTimeMajor. |
24,977 | 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 `BidirectionalSequenceRNNOptionsAddFusedActivationFuncti... | This method is deprecated. Please switch to AddFusedActivationFunction. |
24,978 | import flatbuffers
from flatbuffers.compat import import_numpy
def AddMergeOutputs(builder, mergeOutputs): builder.PrependBoolSlot(2, mergeOutputs, 0)
The provided code snippet includes necessary dependencies for implementing the `BidirectionalSequenceRNNOptionsAddMergeOutputs` function. Write a Python function `def B... | This method is deprecated. Please switch to AddMergeOutputs. |
24,979 | import flatbuffers
from flatbuffers.compat import import_numpy
def AddAsymmetricQuantizeInputs(builder, asymmetricQuantizeInputs): builder.PrependBoolSlot(3, asymmetricQuantizeInputs, 0)
The provided code snippet includes necessary dependencies for implementing the `BidirectionalSequenceRNNOptionsAddAsymmetricQuantize... | This method is deprecated. Please switch to AddAsymmetricQuantizeInputs. |
24,980 | import flatbuffers
from flatbuffers.compat import import_numpy
def End(builder): return builder.EndObject()
The provided code snippet includes necessary dependencies for implementing the `BidirectionalSequenceRNNOptionsEnd` function. Write a Python function `def BidirectionalSequenceRNNOptionsEnd(builder)` to solve th... | This method is deprecated. Please switch to End. |
24,981 | import flatbuffers
from flatbuffers.compat import import_numpy
def Start(builder): builder.StartObject(2)
The provided code snippet includes necessary dependencies for implementing the `MetadataStart` function. Write a Python function `def MetadataStart(builder)` to solve the following problem:
This method is deprecat... | This method is deprecated. Please switch to Start. |
24,982 | import flatbuffers
from flatbuffers.compat import import_numpy
def AddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0)
The provided code snippet includes necessary dependencies for implementing the `MetadataAddName` function. Write a Python function `... | This method is deprecated. Please switch to AddName. |
24,983 | import flatbuffers
from flatbuffers.compat import import_numpy
def AddBuffer(builder, buffer): builder.PrependUint32Slot(1, buffer, 0)
The provided code snippet includes necessary dependencies for implementing the `MetadataAddBuffer` function. Write a Python function `def MetadataAddBuffer(builder, buffer)` to solve t... | This method is deprecated. Please switch to AddBuffer. |
24,984 | import flatbuffers
from flatbuffers.compat import import_numpy
def End(builder): return builder.EndObject()
The provided code snippet includes necessary dependencies for implementing the `MetadataEnd` function. Write a Python function `def MetadataEnd(builder)` to solve the following problem:
This method is deprecated... | This method is deprecated. Please switch to End. |
24,985 | import flatbuffers
from flatbuffers.compat import import_numpy
def Start(builder): builder.StartObject(0)
The provided code snippet includes necessary dependencies for implementing the `PadOptionsStart` function. Write a Python function `def PadOptionsStart(builder)` to solve the following problem:
This method is depr... | This method is deprecated. Please switch to Start. |
24,986 | import flatbuffers
from flatbuffers.compat import import_numpy
def End(builder): return builder.EndObject()
The provided code snippet includes necessary dependencies for implementing the `PadOptionsEnd` function. Write a Python function `def PadOptionsEnd(builder)` to solve the following problem:
This method is deprec... | This method is deprecated. Please switch to End. |
24,987 | import flatbuffers
from flatbuffers.compat import import_numpy
def Start(builder): builder.StartObject(8)
The provided code snippet includes necessary dependencies for implementing the `ModelStart` function. Write a Python function `def ModelStart(builder)` to solve the following problem:
This method is deprecated. Pl... | This method is deprecated. Please switch to Start. |
24,988 | import flatbuffers
from flatbuffers.compat import import_numpy
def AddVersion(builder, version): builder.PrependUint32Slot(0, version, 0)
The provided code snippet includes necessary dependencies for implementing the `ModelAddVersion` function. Write a Python function `def ModelAddVersion(builder, version)` to solve t... | This method is deprecated. Please switch to AddVersion. |
24,989 | import flatbuffers
from flatbuffers.compat import import_numpy
def AddOperatorCodes(builder, operatorCodes): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(operatorCodes), 0)
The provided code snippet includes necessary dependencies for implementing the `ModelAddOperatorCodes` fu... | This method is deprecated. Please switch to AddOperatorCodes. |
24,990 | import flatbuffers
from flatbuffers.compat import import_numpy
def StartOperatorCodesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
The provided code snippet includes necessary dependencies for implementing the `ModelStartOperatorCodesVector` function. Write a Python function `def ModelStartOper... | This method is deprecated. Please switch to Start. |
24,991 | import flatbuffers
from flatbuffers.compat import import_numpy
def AddSubgraphs(builder, subgraphs): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(subgraphs), 0)
The provided code snippet includes necessary dependencies for implementing the `ModelAddSubgraphs` function. Write a ... | This method is deprecated. Please switch to AddSubgraphs. |
24,992 | import flatbuffers
from flatbuffers.compat import import_numpy
def StartSubgraphsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
The provided code snippet includes necessary dependencies for implementing the `ModelStartSubgraphsVector` function. Write a Python function `def ModelStartSubgraphsVec... | This method is deprecated. Please switch to Start. |
24,993 | import flatbuffers
from flatbuffers.compat import import_numpy
def AddDescription(builder, description): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(description), 0)
The provided code snippet includes necessary dependencies for implementing the `ModelAddDescription` function. ... | This method is deprecated. Please switch to AddDescription. |
24,994 | import flatbuffers
from flatbuffers.compat import import_numpy
def AddBuffers(builder, buffers): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(buffers), 0)
The provided code snippet includes necessary dependencies for implementing the `ModelAddBuffers` function. Write a Python f... | This method is deprecated. Please switch to AddBuffers. |
24,995 | import flatbuffers
from flatbuffers.compat import import_numpy
def StartBuffersVector(builder, numElems): return builder.StartVector(4, numElems, 4)
The provided code snippet includes necessary dependencies for implementing the `ModelStartBuffersVector` function. Write a Python function `def ModelStartBuffersVector(bu... | This method is deprecated. Please switch to Start. |
24,996 | import flatbuffers
from flatbuffers.compat import import_numpy
def AddMetadataBuffer(builder, metadataBuffer): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(metadataBuffer), 0)
The provided code snippet includes necessary dependencies for implementing the `ModelAddMetadataBuffer... | This method is deprecated. Please switch to AddMetadataBuffer. |
24,997 | import flatbuffers
from flatbuffers.compat import import_numpy
def StartMetadataBufferVector(builder, numElems): return builder.StartVector(4, numElems, 4)
The provided code snippet includes necessary dependencies for implementing the `ModelStartMetadataBufferVector` function. Write a Python function `def ModelStartMe... | This method is deprecated. Please switch to Start. |
24,998 | import flatbuffers
from flatbuffers.compat import import_numpy
def AddMetadata(builder, metadata): builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(metadata), 0)
The provided code snippet includes necessary dependencies for implementing the `ModelAddMetadata` function. Write a Pyth... | This method is deprecated. Please switch to AddMetadata. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.