Search is not available for this dataset
identifier
stringlengths
1
155
parameters
stringlengths
2
6.09k
docstring
stringlengths
11
63.4k
docstring_summary
stringlengths
0
63.4k
function
stringlengths
29
99.8k
function_tokens
list
start_point
list
end_point
list
language
stringclasses
1 value
docstring_language
stringlengths
2
7
docstring_language_predictions
stringlengths
18
23
is_langid_reliable
stringclasses
2 values
parse_helper
(attrs, attrs_name, alt_value=None)
Helper function to parse operator attributes in required format.
Helper function to parse operator attributes in required format.
def parse_helper(attrs, attrs_name, alt_value=None): """Helper function to parse operator attributes in required format.""" tuple_re = re.compile('\([0-9L|,| ]+\)') if not attrs: return alt_value attrs_str = None if attrs.get(attrs_name) is None else str(attrs.get(attrs_name)) if attrs_str i...
[ "def", "parse_helper", "(", "attrs", ",", "attrs_name", ",", "alt_value", "=", "None", ")", ":", "tuple_re", "=", "re", ".", "compile", "(", "'\\([0-9L|,| ]+\\)'", ")", "if", "not", "attrs", ":", "return", "alt_value", "attrs_str", "=", "None", "if", "attr...
[ 64, 0 ]
[ 79, 20 ]
python
en
['en', 'en', 'en']
True
transform_padding
(pad_width)
Helper function to convert padding format for pad operator.
Helper function to convert padding format for pad operator.
def transform_padding(pad_width): """Helper function to convert padding format for pad operator. """ num_pad_values = len(pad_width) onnx_pad_width = [0]*num_pad_values start_index = 0 # num_pad_values will always be multiple of 2 end_index = int(num_pad_values/2) for idx in range(0, nu...
[ "def", "transform_padding", "(", "pad_width", ")", ":", "num_pad_values", "=", "len", "(", "pad_width", ")", "onnx_pad_width", "=", "[", "0", "]", "*", "num_pad_values", "start_index", "=", "0", "# num_pad_values will always be multiple of 2", "end_index", "=", "int...
[ 81, 0 ]
[ 98, 25 ]
python
en
['en', 'en', 'en']
True
convert_string_to_list
(string_val)
Helper function to convert string to list. Used to convert shape attribute string to list format.
Helper function to convert string to list. Used to convert shape attribute string to list format.
def convert_string_to_list(string_val): """Helper function to convert string to list. Used to convert shape attribute string to list format. """ result_list = [] list_string = string_val.split(',') for val in list_string: val = str(val.strip()) val = val.replace("(", "") ...
[ "def", "convert_string_to_list", "(", "string_val", ")", ":", "result_list", "=", "[", "]", "list_string", "=", "string_val", ".", "split", "(", "','", ")", "for", "val", "in", "list_string", ":", "val", "=", "str", "(", "val", ".", "strip", "(", ")", ...
[ 101, 0 ]
[ 118, 22 ]
python
en
['en', 'en', 'en']
True
get_boolean_attribute_value
(attrs, attr_name)
Helper function to convert a string version of Boolean attributes to integer for ONNX. Takes attribute dictionary and attr_name as parameters.
Helper function to convert a string version of Boolean attributes to integer for ONNX. Takes attribute dictionary and attr_name as parameters.
def get_boolean_attribute_value(attrs, attr_name): """ Helper function to convert a string version of Boolean attributes to integer for ONNX. Takes attribute dictionary and attr_name as parameters. """ return 1 if attrs.get(attr_name, 0) in ["True", "1"] else 0
[ "def", "get_boolean_attribute_value", "(", "attrs", ",", "attr_name", ")", ":", "return", "1", "if", "attrs", ".", "get", "(", "attr_name", ",", "0", ")", "in", "[", "\"True\"", ",", "\"1\"", "]", "else", "0" ]
[ 121, 0 ]
[ 127, 63 ]
python
en
['en', 'en', 'en']
True
get_inputs
(node, kwargs, with_shapes=False)
Helper function to get inputs
Helper function to get inputs
def get_inputs(node, kwargs, with_shapes=False): """Helper function to get inputs""" name = node["name"] proc_nodes = kwargs["proc_nodes"] index_lookup = kwargs["index_lookup"] graph_shapes = kwargs["graph_shapes"] inputs = node["inputs"] attrs = node.get("attrs", {}) input_nodes = [] ...
[ "def", "get_inputs", "(", "node", ",", "kwargs", ",", "with_shapes", "=", "False", ")", ":", "name", "=", "node", "[", "\"name\"", "]", "proc_nodes", "=", "kwargs", "[", "\"proc_nodes\"", "]", "index_lookup", "=", "kwargs", "[", "\"index_lookup\"", "]", "g...
[ 130, 0 ]
[ 155, 35 ]
python
en
['en', 'nl', 'en']
True
create_basic_op_node
(op_name, node, kwargs)
Helper function to create a basic operator node that doesn't contain op specific attrs
Helper function to create a basic operator node that doesn't contain op specific attrs
def create_basic_op_node(op_name, node, kwargs): """Helper function to create a basic operator node that doesn't contain op specific attrs""" name, input_nodes, _ = get_inputs(node, kwargs) node = onnx.helper.make_node( op_name, input_nodes, [name], name=name ) r...
[ "def", "create_basic_op_node", "(", "op_name", ",", "node", ",", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "_", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "node", "=", "onnx", ".", "helper", ".", "make_node", "(", "op_name", ",", "i...
[ 158, 0 ]
[ 169, 17 ]
python
en
['en', 'en', 'en']
True
convert_weights_and_inputs
(node, **kwargs)
Helper function to convert weights and inputs.
Helper function to convert weights and inputs.
def convert_weights_and_inputs(node, **kwargs): """Helper function to convert weights and inputs. """ name, _, _ = get_inputs(node, kwargs) if kwargs["is_input"] is False: weights = kwargs["weights"] initializer = kwargs["initializer"] np_arr = weights[name] data_type = ...
[ "def", "convert_weights_and_inputs", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "_", ",", "_", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "if", "kwargs", "[", "\"is_input\"", "]", "is", "False", ":", "weights", "=", "kwargs",...
[ 173, 0 ]
[ 200, 26 ]
python
en
['en', 'en', 'en']
True
convert_convolution
(node, **kwargs)
Map MXNet's convolution operator attributes to onnx's Conv operator and return the created node.
Map MXNet's convolution operator attributes to onnx's Conv operator and return the created node.
def convert_convolution(node, **kwargs): """Map MXNet's convolution operator attributes to onnx's Conv operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) kernel_dims = list(parse_helper(attrs, "kernel")) stride_dims = list(parse_helper(attrs, "stride",...
[ "def", "convert_convolution", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "kernel_dims", "=", "list", "(", "parse_helper", "(", "attrs", ",", "\"kernel\"", ...
[ 204, 0 ]
[ 230, 22 ]
python
en
['en', 'en', 'en']
True
convert_deconvolution
(node, **kwargs)
Map MXNet's deconvolution operator attributes to onnx's ConvTranspose operator and return the created node.
Map MXNet's deconvolution operator attributes to onnx's ConvTranspose operator and return the created node.
def convert_deconvolution(node, **kwargs): """Map MXNet's deconvolution operator attributes to onnx's ConvTranspose operator and return the created node. """ name, inputs, attrs = get_inputs(node, kwargs) kernel_dims = list(parse_helper(attrs, "kernel")) stride_dims = list(parse_helper(attrs, "...
[ "def", "convert_deconvolution", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "inputs", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "kernel_dims", "=", "list", "(", "parse_helper", "(", "attrs", ",", "\"kernel\"", ")"...
[ 234, 0 ]
[ 262, 24 ]
python
en
['en', 'en', 'en']
True
convert_crop
(node, **kwargs)
Map MXNet's crop operator attributes to onnx's Crop operator and return the created node.
Map MXNet's crop operator attributes to onnx's Crop operator and return the created node.
def convert_crop(node, **kwargs): """Map MXNet's crop operator attributes to onnx's Crop operator and return the created node. """ name, inputs, attrs = get_inputs(node, kwargs) start = np.array([0, 0, 0, 0], dtype=np.int) # index是int类型 export_nodes = [] start_node = create_helper_tenso...
[ "def", "convert_crop", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "inputs", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "start", "=", "np", ".", "array", "(", "[", "0", ",", "0", ",", "0", ",", "0", "]", ...
[ 298, 0 ]
[ 328, 23 ]
python
en
['en', 'en', 'en']
True
convert_upsample
(node, **kwargs)
Map MXNet's UpSampling operator attributes to onnx's Upsample operator and return the created node.
Map MXNet's UpSampling operator attributes to onnx's Upsample operator and return the created node.
def convert_upsample(node, **kwargs): """Map MXNet's UpSampling operator attributes to onnx's Upsample operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) sample_type = attrs.get('sample_type', 'nearest') sample_type = 'linear' if sample_type == 'bilin...
[ "def", "convert_upsample", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "sample_type", "=", "attrs", ".", "get", "(", "'sample_type'", ",", "'nearest'", ")",...
[ 332, 0 ]
[ 370, 23 ]
python
en
['en', 'en', 'en']
True
convert_fully_connected
(node, **kwargs)
Map MXNet's FullyConnected operator attributes to onnx's Gemm operator and return the created node.
Map MXNet's FullyConnected operator attributes to onnx's Gemm operator and return the created node.
def convert_fully_connected(node, **kwargs): """Map MXNet's FullyConnected operator attributes to onnx's Gemm operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) initializer = kwargs["initializer"] no_bias = get_boolean_attribute_value(attrs, "no_bias"...
[ "def", "convert_fully_connected", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "initializer", "=", "kwargs", "[", "\"initializer\"", "]", "no_bias", "=", "get_...
[ 435, 0 ]
[ 487, 17 ]
python
en
['en', 'en', 'en']
True
convert_batchnorm
(node, **kwargs)
Map MXNet's BatchNorm operator attributes to onnx's BatchNormalization operator and return the created node.
Map MXNet's BatchNorm operator attributes to onnx's BatchNormalization operator and return the created node.
def convert_batchnorm(node, **kwargs): """Map MXNet's BatchNorm operator attributes to onnx's BatchNormalization operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) momentum = float(attrs.get("momentum", 0.9)) eps = float(attrs.get("eps", 0.001)) b...
[ "def", "convert_batchnorm", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "momentum", "=", "float", "(", "attrs", ".", "get", "(", "\"momentum\"", ",", "0.9...
[ 491, 0 ]
[ 512, 20 ]
python
en
['en', 'cs', 'en']
True
convert_tanh
(node, **kwargs)
Map MXNet's tanh operator attributes to onnx's Tanh operator and return the created node.
Map MXNet's tanh operator attributes to onnx's Tanh operator and return the created node.
def convert_tanh(node, **kwargs): """Map MXNet's tanh operator attributes to onnx's Tanh operator and return the created node. """ return create_basic_op_node('Tanh', node, kwargs)
[ "def", "convert_tanh", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Tanh'", ",", "node", ",", "kwargs", ")" ]
[ 516, 0 ]
[ 520, 53 ]
python
en
['en', 'en', 'en']
True
convert_cos
(node, **kwargs)
Map MXNet's cos operator attributes to onnx's Cos operator and return the created node.
Map MXNet's cos operator attributes to onnx's Cos operator and return the created node.
def convert_cos(node, **kwargs): """Map MXNet's cos operator attributes to onnx's Cos operator and return the created node. """ return create_basic_op_node('Cos', node, kwargs)
[ "def", "convert_cos", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Cos'", ",", "node", ",", "kwargs", ")" ]
[ 523, 0 ]
[ 527, 52 ]
python
en
['en', 'en', 'en']
True
convert_sin
(node, **kwargs)
Map MXNet's sin operator attributes to onnx's Sin operator and return the created node.
Map MXNet's sin operator attributes to onnx's Sin operator and return the created node.
def convert_sin(node, **kwargs): """Map MXNet's sin operator attributes to onnx's Sin operator and return the created node. """ return create_basic_op_node('Sin', node, kwargs)
[ "def", "convert_sin", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Sin'", ",", "node", ",", "kwargs", ")" ]
[ 530, 0 ]
[ 534, 52 ]
python
en
['en', 'en', 'en']
True
convert_tan
(node, **kwargs)
Map MXNet's tan operator attributes to onnx's tan operator and return the created node.
Map MXNet's tan operator attributes to onnx's tan operator and return the created node.
def convert_tan(node, **kwargs): """Map MXNet's tan operator attributes to onnx's tan operator and return the created node. """ return create_basic_op_node('Tan', node, kwargs)
[ "def", "convert_tan", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Tan'", ",", "node", ",", "kwargs", ")" ]
[ 537, 0 ]
[ 541, 52 ]
python
en
['id', 'en', 'en']
True
convert_acos
(node, **kwargs)
Map MXNet's acos operator attributes to onnx's acos operator and return the created node.
Map MXNet's acos operator attributes to onnx's acos operator and return the created node.
def convert_acos(node, **kwargs): """Map MXNet's acos operator attributes to onnx's acos operator and return the created node. """ return create_basic_op_node('Acos', node, kwargs)
[ "def", "convert_acos", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Acos'", ",", "node", ",", "kwargs", ")" ]
[ 544, 0 ]
[ 548, 53 ]
python
en
['en', 'en', 'en']
True
convert_asin
(node, **kwargs)
Map MXNet's asin operator attributes to onnx's asin operator and return the created node.
Map MXNet's asin operator attributes to onnx's asin operator and return the created node.
def convert_asin(node, **kwargs): """Map MXNet's asin operator attributes to onnx's asin operator and return the created node. """ return create_basic_op_node('Asin', node, kwargs)
[ "def", "convert_asin", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Asin'", ",", "node", ",", "kwargs", ")" ]
[ 551, 0 ]
[ 555, 53 ]
python
en
['en', 'en', 'en']
True
convert_atan
(node, **kwargs)
Map MXNet's atan operator attributes to onnx's atan operator and return the created node.
Map MXNet's atan operator attributes to onnx's atan operator and return the created node.
def convert_atan(node, **kwargs): """Map MXNet's atan operator attributes to onnx's atan operator and return the created node. """ return create_basic_op_node('Atan', node, kwargs)
[ "def", "convert_atan", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Atan'", ",", "node", ",", "kwargs", ")" ]
[ 558, 0 ]
[ 562, 53 ]
python
en
['en', 'su', 'en']
True
convert_sigmoid
(node, **kwargs)
Map MXNet's sigmoid operator attributes to onnx's Sigmoid operator and return the created node.
Map MXNet's sigmoid operator attributes to onnx's Sigmoid operator and return the created node.
def convert_sigmoid(node, **kwargs): """Map MXNet's sigmoid operator attributes to onnx's Sigmoid operator and return the created node. """ return create_basic_op_node('Sigmoid', node, kwargs)
[ "def", "convert_sigmoid", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Sigmoid'", ",", "node", ",", "kwargs", ")" ]
[ 566, 0 ]
[ 570, 56 ]
python
en
['en', 'en', 'en']
True
convert_relu
(node, **kwargs)
Map MXNet's relu operator attributes to onnx's Relu operator and return the created node.
Map MXNet's relu operator attributes to onnx's Relu operator and return the created node.
def convert_relu(node, **kwargs): """Map MXNet's relu operator attributes to onnx's Relu operator and return the created node. """ return create_basic_op_node('Relu', node, kwargs)
[ "def", "convert_relu", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Relu'", ",", "node", ",", "kwargs", ")" ]
[ 573, 0 ]
[ 577, 53 ]
python
en
['en', 'en', 'en']
True
convert_activation
(node, **kwargs)
Map MXNet's Activation operator attributes to onnx's Tanh/Relu operator and return the created node.
Map MXNet's Activation operator attributes to onnx's Tanh/Relu operator and return the created node.
def convert_activation(node, **kwargs): """Map MXNet's Activation operator attributes to onnx's Tanh/Relu operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) act_type = attrs["act_type"] # Creating a dictionary here, but if this titlecase pattern #...
[ "def", "convert_activation", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "act_type", "=", "attrs", "[", "\"act_type\"", "]", "# Creating a dictionary here, but if...
[ 580, 0 ]
[ 611, 17 ]
python
en
['en', 'en', 'en']
True
convert_pad
(node, **kwargs)
Map MXNet's pad operator attributes to onnx's Pad operator and return the created node.
Map MXNet's pad operator attributes to onnx's Pad operator and return the created node.
def convert_pad(node, **kwargs): """Map MXNet's pad operator attributes to onnx's Pad operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) mxnet_pad_width = convert_string_to_list(attrs.get("pad_width")) onnx_pad_width = transform_padding(mxnet_pad_width...
[ "def", "convert_pad", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "mxnet_pad_width", "=", "convert_string_to_list", "(", "attrs", ".", "get", "(", "\"pad_widt...
[ 615, 0 ]
[ 648, 17 ]
python
en
['en', 'en', 'en']
True
create_helper_tensor_node
(input_vals, output_name, kwargs)
create extra tensor node from numpy values
create extra tensor node from numpy values
def create_helper_tensor_node(input_vals, output_name, kwargs): """create extra tensor node from numpy values""" data_type = onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[input_vals.dtype] tensor_node = onnx.helper.make_tensor_value_info( name=output_name, elem_type=data_type, shape=input_val...
[ "def", "create_helper_tensor_node", "(", "input_vals", ",", "output_name", ",", "kwargs", ")", ":", "data_type", "=", "onnx", ".", "mapping", ".", "NP_TYPE_TO_TENSOR_TYPE", "[", "input_vals", ".", "dtype", "]", "tensor_node", "=", "onnx", ".", "helper", ".", "...
[ 650, 0 ]
[ 669, 24 ]
python
en
['en', 'en', 'en']
True
create_helper_reshape_node
(input_name, output_name, shape, kwargs)
create extra reshape node with static shape
create extra reshape node with static shape
def create_helper_reshape_node(input_name, output_name, shape, kwargs): """create extra reshape node with static shape""" shape_tensor_node, = create_helper_tensor_node( np.asarray(shape, dtype=np.int64), output_name + "__shape", kwargs ) reshape_node = onnx.helper.make_node( "Reshape", ...
[ "def", "create_helper_reshape_node", "(", "input_name", ",", "output_name", ",", "shape", ",", "kwargs", ")", ":", "shape_tensor_node", ",", "=", "create_helper_tensor_node", "(", "np", ".", "asarray", "(", "shape", ",", "dtype", "=", "np", ".", "int64", ")", ...
[ 671, 0 ]
[ 683, 44 ]
python
en
['en', 'en', 'en']
True
create_helper_trans_node
(input_name, output_name, perm=None)
create extra transpose node
create extra transpose node
def create_helper_trans_node(input_name, output_name, perm=None): """create extra transpose node""" attrs = {} if perm is not None: attrs['perm'] = perm trans_node = onnx.helper.make_node( 'Transpose', inputs=[input_name], outputs=[output_name], name=output_name, ...
[ "def", "create_helper_trans_node", "(", "input_name", ",", "output_name", ",", "perm", "=", "None", ")", ":", "attrs", "=", "{", "}", "if", "perm", "is", "not", "None", ":", "attrs", "[", "'perm'", "]", "=", "perm", "trans_node", "=", "onnx", ".", "hel...
[ 685, 0 ]
[ 697, 23 ]
python
en
['es', 'pt', 'en']
False
create_helper_concat_node
(inputs, output_name, axis=0)
create extra concat node
create extra concat node
def create_helper_concat_node(inputs, output_name, axis=0): """create extra concat node""" concat_node = onnx.helper.make_node( "Concat", inputs=inputs, outputs=[output_name], name=output_name, axis=axis, ) return [concat_node]
[ "def", "create_helper_concat_node", "(", "inputs", ",", "output_name", ",", "axis", "=", "0", ")", ":", "concat_node", "=", "onnx", ".", "helper", ".", "make_node", "(", "\"Concat\"", ",", "inputs", "=", "inputs", ",", "outputs", "=", "[", "output_name", "...
[ 699, 0 ]
[ 708, 24 ]
python
es
['es', 'la', 'it']
False
create_helper_expand_node
(input_name, output_name, expand_shape)
create extra expand node
create extra expand node
def create_helper_expand_node(input_name, output_name, expand_shape): """create extra expand node""" expand_node = onnx.helper.make_node( "Expand", inputs=[input_name, expand_shape], outputs=[output_name], name=output_name, ) return [expand_node]
[ "def", "create_helper_expand_node", "(", "input_name", ",", "output_name", ",", "expand_shape", ")", ":", "expand_node", "=", "onnx", ".", "helper", ".", "make_node", "(", "\"Expand\"", ",", "inputs", "=", "[", "input_name", ",", "expand_shape", "]", ",", "out...
[ 710, 0 ]
[ 718, 24 ]
python
en
['es', 'pt', 'en']
False
create_helper_gather_node
( input_name, output_name, indices, kwargs, axis=None )
create extra gather node with static indices
create extra gather node with static indices
def create_helper_gather_node( input_name, output_name, indices, kwargs, axis=None ): """create extra gather node with static indices""" attrs = {} if axis is not None: attrs['axis'] = axis gather_tensor_node, = create_helper_tensor_node( np.asarray(indices, n...
[ "def", "create_helper_gather_node", "(", "input_name", ",", "output_name", ",", "indices", ",", "kwargs", ",", "axis", "=", "None", ")", ":", "attrs", "=", "{", "}", "if", "axis", "is", "not", "None", ":", "attrs", "[", "'axis'", "]", "=", "axis", "gat...
[ 720, 0 ]
[ 739, 44 ]
python
en
['en', 'en', 'en']
True
create_helper_build_values_node
( inputs, output_name, dtype, kwargs, axis=0 )
create extra node, with specified values (allows mixing node names and static values)
create extra node, with specified values
def create_helper_build_values_node( inputs, output_name, dtype, kwargs, axis=0 ): """create extra node, with specified values (allows mixing node names and static values) """ values = [] tensor_nodes = [] for idx, inp in enumerate(inputs): if not isinstance(inp, (st...
[ "def", "create_helper_build_values_node", "(", "inputs", ",", "output_name", ",", "dtype", ",", "kwargs", ",", "axis", "=", "0", ")", ":", "values", "=", "[", "]", "tensor_nodes", "=", "[", "]", "for", "idx", ",", "inp", "in", "enumerate", "(", "inputs",...
[ 741, 0 ]
[ 762, 40 ]
python
en
['en', 'en', 'en']
True
create_helper_shape_node
(input_name, output_name)
create extra shape node for specified input node
create extra shape node for specified input node
def create_helper_shape_node(input_name, output_name): """create extra shape node for specified input node""" shape_node = onnx.helper.make_node( "Shape", inputs=[input_name], outputs=[output_name], name=output_name, ) return [shape_node]
[ "def", "create_helper_shape_node", "(", "input_name", ",", "output_name", ")", ":", "shape_node", "=", "onnx", ".", "helper", ".", "make_node", "(", "\"Shape\"", ",", "inputs", "=", "[", "input_name", "]", ",", "outputs", "=", "[", "output_name", "]", ",", ...
[ 764, 0 ]
[ 772, 23 ]
python
en
['en', 'en', 'en']
True
convert_dot
(node, **kwargs)
Map MXNet's dot operator attributes to onnx's MatMul and Transpose operators based on the values set for transpose_a, transpose_b attributes.
Map MXNet's dot operator attributes to onnx's MatMul and Transpose operators based on the values set for transpose_a, transpose_b attributes.
def convert_dot(node, **kwargs): """Map MXNet's dot operator attributes to onnx's MatMul and Transpose operators based on the values set for transpose_a, transpose_b attributes.""" name, input_nodes, attrs = get_inputs(node, kwargs) input_node_a = input_nodes[0] input_node_b = input_nodes[1] ...
[ "def", "convert_dot", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "input_node_a", "=", "input_nodes", "[", "0", "]", "input_node_b", "=", "input_nodes", "["...
[ 775, 0 ]
[ 812, 56 ]
python
en
['en', 'en', 'en']
True
convert_linalg_gemm2
(node, **kwargs)
Map MXNet's _linalg_gemm2 operator attributes to onnx's MatMul and Transpose operators based on the values set for transpose_a, transpose_b attributes. Return multiple nodes created.
Map MXNet's _linalg_gemm2 operator attributes to onnx's MatMul and Transpose operators based on the values set for transpose_a, transpose_b attributes. Return multiple nodes created.
def convert_linalg_gemm2(node, **kwargs): """Map MXNet's _linalg_gemm2 operator attributes to onnx's MatMul and Transpose operators based on the values set for transpose_a, transpose_b attributes. Return multiple nodes created. """ name, input_nodes, attrs = get_inputs(node, kwargs) # Getti...
[ "def", "convert_linalg_gemm2", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "# Getting the attributes and assigning default values.", "alpha", "=", "float", "(", "at...
[ 816, 0 ]
[ 898, 56 ]
python
en
['en', 'en', 'en']
True
convert_pooling
(node, **kwargs)
Map MXNet's Pooling operator attributes to onnx's MaxPool/AveragePool/GlobalMaxPool/GlobalAveragePool operators based on the input node's attributes and return the created node.
Map MXNet's Pooling operator attributes to onnx's MaxPool/AveragePool/GlobalMaxPool/GlobalAveragePool operators based on the input node's attributes and return the created node.
def convert_pooling(node, **kwargs): """Map MXNet's Pooling operator attributes to onnx's MaxPool/AveragePool/GlobalMaxPool/GlobalAveragePool operators based on the input node's attributes and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) kernel = eval(attrs["...
[ "def", "convert_pooling", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "kernel", "=", "eval", "(", "attrs", "[", "\"kernel\"", "]", ")", "pool_type", "=", ...
[ 902, 0 ]
[ 985, 17 ]
python
en
['en', 'en', 'en']
True
convert_exp
(node, **kwargs)
Map MXNet's exp operator attributes to onnx's Exp operator and return the created node.
Map MXNet's exp operator attributes to onnx's Exp operator and return the created node.
def convert_exp(node, **kwargs): """Map MXNet's exp operator attributes to onnx's Exp operator and return the created node. """ return create_basic_op_node('Exp', node, kwargs)
[ "def", "convert_exp", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Exp'", ",", "node", ",", "kwargs", ")" ]
[ 989, 0 ]
[ 993, 52 ]
python
en
['en', 'en', 'en']
True
convert_copy
(node, **kwargs)
Map MXNet's _copy operator attributes to onnx's Identity operator and return the created node.
Map MXNet's _copy operator attributes to onnx's Identity operator and return the created node.
def convert_copy(node, **kwargs): """Map MXNet's _copy operator attributes to onnx's Identity operator and return the created node. """ return create_basic_op_node('Identity', node, kwargs)
[ "def", "convert_copy", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Identity'", ",", "node", ",", "kwargs", ")" ]
[ 996, 0 ]
[ 1000, 57 ]
python
en
['en', 'en', 'en']
True
convert_identity
(node, **kwargs)
Map MXNet's identity operator attributes to onnx's ConstantFill operator and return the created node.
Map MXNet's identity operator attributes to onnx's ConstantFill operator and return the created node.
def convert_identity(node, **kwargs): """Map MXNet's identity operator attributes to onnx's ConstantFill operator and return the created node. """ return create_basic_op_node('ConstantFill', node, kwargs)
[ "def", "convert_identity", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'ConstantFill'", ",", "node", ",", "kwargs", ")" ]
[ 1003, 0 ]
[ 1007, 61 ]
python
en
['en', 'en', 'en']
True
convert_instancenorm
(node, **kwargs)
Map MXNet's InstanceNorm operator attributes to onnx's InstanceNormalization operator based on the input node's attributes and return the created node.
Map MXNet's InstanceNorm operator attributes to onnx's InstanceNormalization operator based on the input node's attributes and return the created node.
def convert_instancenorm(node, **kwargs): """Map MXNet's InstanceNorm operator attributes to onnx's InstanceNormalization operator based on the input node's attributes and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) eps = float(attrs.get("eps", 0.001)) node...
[ "def", "convert_instancenorm", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "eps", "=", "float", "(", "attrs", ".", "get", "(", "\"eps\"", ",", "0.001", ...
[ 1010, 0 ]
[ 1025, 17 ]
python
en
['en', 'en', 'en']
True
convert_leakyrelu
(node, **kwargs)
Map MXNet's LeakyReLU operator attributes to onnx's Elu/LeakyRelu/PRelu operators based on the input node's attributes and return the created node.
Map MXNet's LeakyReLU operator attributes to onnx's Elu/LeakyRelu/PRelu operators based on the input node's attributes and return the created node.
def convert_leakyrelu(node, **kwargs): """Map MXNet's LeakyReLU operator attributes to onnx's Elu/LeakyRelu/PRelu operators based on the input node's attributes and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) initializer = kwargs["initializer"] act_type = at...
[ "def", "convert_leakyrelu", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "initializer", "=", "kwargs", "[", "\"initializer\"", "]", "act_type", "=", "attrs", ...
[ 1031, 0 ]
[ 1089, 18 ]
python
af
['en', 'af', 'sw']
False
convert_softmax
(node, **kwargs)
Map MXNet's softmax operator attributes to onnx's Softmax operator and return the created node.
Map MXNet's softmax operator attributes to onnx's Softmax operator and return the created node.
def convert_softmax(node, **kwargs): """Map MXNet's softmax operator attributes to onnx's Softmax operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) axis = int(attrs.get("axis", -1)) c_softmax_node = [] axis = -1 transpose_node1 = onnx.helper....
[ "def", "convert_softmax", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "axis", "=", "int", "(", "attrs", ".", "get", "(", "\"axis\"", ",", "-", "1", ")...
[ 1111, 0 ]
[ 1149, 25 ]
python
en
['en', 'en', 'en']
True
convert_blockgrad
(node, **kwargs)
Skip operator
Skip operator
def convert_blockgrad(node, **kwargs): """ Skip operator """ return create_basic_op_node('ConstantFill', node, kwargs)
[ "def", "convert_blockgrad", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'ConstantFill'", ",", "node", ",", "kwargs", ")" ]
[ 1153, 0 ]
[ 1155, 61 ]
python
en
['en', 'hr', 'en']
False
convert_makeloss
(node, **kwargs)
Skip operator
Skip operator
def convert_makeloss(node, **kwargs): """ Skip operator """ return create_basic_op_node('ConstantFill', node, kwargs)
[ "def", "convert_makeloss", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'ConstantFill'", ",", "node", ",", "kwargs", ")" ]
[ 1158, 0 ]
[ 1160, 61 ]
python
en
['en', 'hr', 'en']
False
convert_concat
(node, **kwargs)
Map MXNet's Concat operator attributes to onnx's Concat operator and return the created node.
Map MXNet's Concat operator attributes to onnx's Concat operator and return the created node.
def convert_concat(node, **kwargs): """Map MXNet's Concat operator attributes to onnx's Concat operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) axis = int(attrs.get("dim", 1)) concat_node = onnx.helper.make_node( "Concat", input_nodes...
[ "def", "convert_concat", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "axis", "=", "int", "(", "attrs", ".", "get", "(", "\"dim\"", ",", "1", ")", ")",...
[ 1163, 0 ]
[ 1177, 24 ]
python
en
['en', 'la', 'en']
True
convert_RNN
(node, **kwargs)
Map MXNet's RNN operator attributes to onnx's RNN operator and return the created node.
Map MXNet's RNN operator attributes to onnx's RNN operator and return the created node.
def convert_RNN(node, **kwargs): """Map MXNet's RNN operator attributes to onnx's RNN operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) nodes = [] # ============================== Attributes ============================== mode = attrs['mode'].uppe...
[ "def", "convert_RNN", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "nodes", "=", "[", "]", "# ============================== Attributes =============================="...
[ 1180, 0 ]
[ 1391, 16 ]
python
en
['en', 'mt', 'en']
True
convert_rnn_param_concat
(node, **kwargs)
Map MXNet's _rnn_param_concat operator attributes to onnx's Concat operator and return the created node.
Map MXNet's _rnn_param_concat operator attributes to onnx's Concat operator and return the created node.
def convert_rnn_param_concat(node, **kwargs): """Map MXNet's _rnn_param_concat operator attributes to onnx's Concat operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) axis = int(attrs.get("dim")) # mxnet RNN node and ONNX RNN/LSTM/GRU nodes # use d...
[ "def", "convert_rnn_param_concat", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "axis", "=", "int", "(", "attrs", ".", "get", "(", "\"dim\"", ")", ")", "...
[ 1394, 0 ]
[ 1458, 20 ]
python
en
['en', 'la', 'en']
True
convert_full
(node, **kwargs)
Map MXNet's _zeros, _ones and _full operators attributes to onnx's tensors and return the created node.
Map MXNet's _zeros, _ones and _full operators attributes to onnx's tensors and return the created node.
def convert_full(node, **kwargs): """Map MXNet's _zeros, _ones and _full operators attributes to onnx's tensors and return the created node. """ # ToDo: Use Constant or ConstantOfShape, when Issue #15101 is resolved? name, input_nodes, attrs = get_inputs(node, kwargs) del input_nodes # Conv...
[ "def", "convert_full", "(", "node", ",", "*", "*", "kwargs", ")", ":", "# ToDo: Use Constant or ConstantOfShape, when Issue #15101 is resolved?", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "del", "input_nodes", "# C...
[ 1463, 0 ]
[ 1484, 56 ]
python
en
['en', 'en', 'en']
True
convert_transpose
(node, **kwargs)
Map MXNet's transpose operator attributes to onnx's Transpose operator and return the created node.
Map MXNet's transpose operator attributes to onnx's Transpose operator and return the created node.
def convert_transpose(node, **kwargs): """Map MXNet's transpose operator attributes to onnx's Transpose operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) axes = attrs.get("axes", ()) if axes: axes = tuple(map(int, re.findall(r'\d+', axes))) ...
[ "def", "convert_transpose", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "axes", "=", "attrs", ".", "get", "(", "\"axes\"", ",", "(", ")", ")", "if", "...
[ 1487, 0 ]
[ 1512, 27 ]
python
en
['en', 'en', 'en']
True
convert_lrn
(node, **kwargs)
Map MXNet's LRN operator attributes to onnx's LRN operator and return the created node.
Map MXNet's LRN operator attributes to onnx's LRN operator and return the created node.
def convert_lrn(node, **kwargs): """Map MXNet's LRN operator attributes to onnx's LRN operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) alpha = float(attrs.get("alpha", 0.0001)) beta = float(attrs.get("beta", 0.75)) bias = float(attrs.get("knorm",...
[ "def", "convert_lrn", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "alpha", "=", "float", "(", "attrs", ".", "get", "(", "\"alpha\"", ",", "0.0001", ")",...
[ 1516, 0 ]
[ 1538, 21 ]
python
en
['en', 'mt', 'en']
True
convert_l2normalization
(node, **kwargs)
Map MXNet's L2Normalization operator attributes to onnx's LpNormalization operator and return the created node.
Map MXNet's L2Normalization operator attributes to onnx's LpNormalization operator and return the created node.
def convert_l2normalization(node, **kwargs): """Map MXNet's L2Normalization operator attributes to onnx's LpNormalization operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) mode = attrs.get("mode", "instance") if mode != "channel": raise Attri...
[ "def", "convert_l2normalization", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "mode", "=", "attrs", ".", "get", "(", "\"mode\"", ",", "\"instance\"", ")", ...
[ 1542, 0 ]
[ 1560, 24 ]
python
en
['en', 'co', 'en']
True
convert_dropout
(node, **kwargs)
Map MXNet's Dropout operator attributes to onnx's Dropout operator and return the created node.
Map MXNet's Dropout operator attributes to onnx's Dropout operator and return the created node.
def convert_dropout(node, **kwargs): """Map MXNet's Dropout operator attributes to onnx's Dropout operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) probability = float(attrs.get("p", 0.5)) probability = np.array(probability, dtype=np.float32) tra...
[ "def", "convert_dropout", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "probability", "=", "float", "(", "attrs", ".", "get", "(", "\"p\"", ",", "0.5", "...
[ 1582, 0 ]
[ 1604, 25 ]
python
en
['en', 'en', 'en']
True
convert_flatten
(node, **kwargs)
Map MXNet's Flatten operator attributes to onnx's Flatten operator and return the created node.
Map MXNet's Flatten operator attributes to onnx's Flatten operator and return the created node.
def convert_flatten(node, **kwargs): """Map MXNet's Flatten operator attributes to onnx's Flatten operator and return the created node. """ return create_basic_op_node('Flatten', node, kwargs)
[ "def", "convert_flatten", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Flatten'", ",", "node", ",", "kwargs", ")" ]
[ 1607, 0 ]
[ 1611, 56 ]
python
en
['en', 'fi', 'en']
True
convert_clip
(node, **kwargs)
Map MXNet's Clip operator attributes to onnx's Clip operator and return the created node.
Map MXNet's Clip operator attributes to onnx's Clip operator and return the created node.
def convert_clip(node, **kwargs): """Map MXNet's Clip operator attributes to onnx's Clip operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) a_min = np.float(attrs.get('a_min', -np.inf)) a_max = np.float(attrs.get('a_max', np.inf)) clip_node = onnx...
[ "def", "convert_clip", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "a_min", "=", "np", ".", "float", "(", "attrs", ".", "get", "(", "'a_min'", ",", "-...
[ 1614, 0 ]
[ 1631, 22 ]
python
en
['en', 'en', 'en']
True
scalar_op_helper
(node, op_name, **kwargs)
Helper function for scalar arithmetic operations
Helper function for scalar arithmetic operations
def scalar_op_helper(node, op_name, **kwargs): """Helper function for scalar arithmetic operations""" name, input_nodes, attrs = get_inputs(node, kwargs) from onnx import numpy_helper input_type = kwargs["in_type"] scalar_value = np.array([attrs.get("scalar", 1)], dtype=o...
[ "def", "scalar_op_helper", "(", "node", ",", "op_name", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "from", "onnx", "import", "numpy_helper", "input_type", "=", "kwargs", ...
[ 1634, 0 ]
[ 1708, 28 ]
python
en
['en', 'en', 'en']
True
convert_mul_scalar
(node, **kwargs)
Map MXNet's _mul_scalar operator attributes to onnx's Mul operator. Creates a new node for the input scalar value, adds it to the initializer and return multiple created nodes.
Map MXNet's _mul_scalar operator attributes to onnx's Mul operator. Creates a new node for the input scalar value, adds it to the initializer and return multiple created nodes.
def convert_mul_scalar(node, **kwargs): """Map MXNet's _mul_scalar operator attributes to onnx's Mul operator. Creates a new node for the input scalar value, adds it to the initializer and return multiple created nodes. """ return scalar_op_helper(node, 'Mul', **kwargs)
[ "def", "convert_mul_scalar", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "scalar_op_helper", "(", "node", ",", "'Mul'", ",", "*", "*", "kwargs", ")" ]
[ 1712, 0 ]
[ 1717, 50 ]
python
en
['en', 'en', 'en']
True
convert_minus_scalar
(node, **kwargs)
Map MXNet's _minus_scalar operator attributes to onnx's Minus operator. Creates a new node for the input scalar value, adds it to the initializer and return multiple created nodes.
Map MXNet's _minus_scalar operator attributes to onnx's Minus operator. Creates a new node for the input scalar value, adds it to the initializer and return multiple created nodes.
def convert_minus_scalar(node, **kwargs): """Map MXNet's _minus_scalar operator attributes to onnx's Minus operator. Creates a new node for the input scalar value, adds it to the initializer and return multiple created nodes. """ return scalar_op_helper(node, 'Sub', **kwargs)
[ "def", "convert_minus_scalar", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "scalar_op_helper", "(", "node", ",", "'Sub'", ",", "*", "*", "kwargs", ")" ]
[ 1722, 0 ]
[ 1727, 50 ]
python
en
['en', 'fi', 'en']
True
convert_rminus_scalar
(node, **kwargs)
Map MXNet's _rminus_scalar operator attributes to onnx's Sub operator. Creates a new node for the input scalar value, adds it to the initializer and return multiple created nodes.
Map MXNet's _rminus_scalar operator attributes to onnx's Sub operator. Creates a new node for the input scalar value, adds it to the initializer and return multiple created nodes.
def convert_rminus_scalar(node, **kwargs): """Map MXNet's _rminus_scalar operator attributes to onnx's Sub operator. Creates a new node for the input scalar value, adds it to the initializer and return multiple created nodes. """ return scalar_op_helper(node, 'Sub', **kwargs)
[ "def", "convert_rminus_scalar", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "scalar_op_helper", "(", "node", ",", "'Sub'", ",", "*", "*", "kwargs", ")" ]
[ 1730, 0 ]
[ 1735, 50 ]
python
en
['en', 'la', 'en']
True
convert_add_scalar
(node, **kwargs)
Map MXNet's _plus_scalar operator attributes to onnx's Add operator. Creates a new node for the input scalar value, adds it to the initializer and return multiple created nodes.
Map MXNet's _plus_scalar operator attributes to onnx's Add operator. Creates a new node for the input scalar value, adds it to the initializer and return multiple created nodes.
def convert_add_scalar(node, **kwargs): """Map MXNet's _plus_scalar operator attributes to onnx's Add operator. Creates a new node for the input scalar value, adds it to the initializer and return multiple created nodes. """ return scalar_op_helper(node, 'Add', **kwargs)
[ "def", "convert_add_scalar", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "scalar_op_helper", "(", "node", ",", "'Add'", ",", "*", "*", "kwargs", ")" ]
[ 1739, 0 ]
[ 1744, 50 ]
python
en
['en', 'en', 'en']
True
convert_div_scalar
(node, **kwargs)
Map MXNet's _div_scalar operator attributes to onnx's Div operator. Creates a new node for the input scalar value, adds it to the initializer and return multiple created nodes.
Map MXNet's _div_scalar operator attributes to onnx's Div operator. Creates a new node for the input scalar value, adds it to the initializer and return multiple created nodes.
def convert_div_scalar(node, **kwargs): """Map MXNet's _div_scalar operator attributes to onnx's Div operator. Creates a new node for the input scalar value, adds it to the initializer and return multiple created nodes. """ return scalar_op_helper(node, 'Div', **kwargs)
[ "def", "convert_div_scalar", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "scalar_op_helper", "(", "node", ",", "'Div'", ",", "*", "*", "kwargs", ")" ]
[ 1748, 0 ]
[ 1753, 50 ]
python
en
['en', 'en', 'en']
True
convert_rdiv_scalar
(node, **kwargs)
Map MXNet's _rdiv_scalar operator attributes to onnx's Div operator. Creates a new node for the input scalar value, adds it to the initializer and return multiple created nodes.
Map MXNet's _rdiv_scalar operator attributes to onnx's Div operator. Creates a new node for the input scalar value, adds it to the initializer and return multiple created nodes.
def convert_rdiv_scalar(node, **kwargs): """Map MXNet's _rdiv_scalar operator attributes to onnx's Div operator. Creates a new node for the input scalar value, adds it to the initializer and return multiple created nodes. """ return scalar_op_helper(node, 'Div', **kwargs)
[ "def", "convert_rdiv_scalar", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "scalar_op_helper", "(", "node", ",", "'Div'", ",", "*", "*", "kwargs", ")" ]
[ 1756, 0 ]
[ 1761, 50 ]
python
en
['en', 'en', 'en']
True
convert_pow_scalar
(node, **kwargs)
Map MXNet's _pow_scalar operator attributes to onnx's Pow operator. Creates a new node for the input scalar value, adds it to the initializer and return multiple created nodes.
Map MXNet's _pow_scalar operator attributes to onnx's Pow operator. Creates a new node for the input scalar value, adds it to the initializer and return multiple created nodes.
def convert_pow_scalar(node, **kwargs): """Map MXNet's _pow_scalar operator attributes to onnx's Pow operator. Creates a new node for the input scalar value, adds it to the initializer and return multiple created nodes. """ return scalar_op_helper(node, 'Pow', **kwargs)
[ "def", "convert_pow_scalar", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "scalar_op_helper", "(", "node", ",", "'Pow'", ",", "*", "*", "kwargs", ")" ]
[ 1764, 0 ]
[ 1769, 50 ]
python
en
['en', 'el-Latn', 'en']
True
convert_argmax
(node, **kwargs)
Map MXNet's argmax operator attributes to onnx's ArgMax operator and return the created node.
Map MXNet's argmax operator attributes to onnx's ArgMax operator and return the created node.
def convert_argmax(node, **kwargs): """Map MXNet's argmax operator attributes to onnx's ArgMax operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) axis = int(attrs.get("axis")) keepdims = get_boolean_attribute_value(attrs, "keepdims") node = onnx.h...
[ "def", "convert_argmax", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "axis", "=", "int", "(", "attrs", ".", "get", "(", "\"axis\"", ")", ")", "keepdims"...
[ 1773, 0 ]
[ 1790, 17 ]
python
en
['en', 'en', 'en']
True
convert_argmin
(node, **kwargs)
Map MXNet's argmin operator attributes to onnx's ArgMin operator and return the created node.
Map MXNet's argmin operator attributes to onnx's ArgMin operator and return the created node.
def convert_argmin(node, **kwargs): """Map MXNet's argmin operator attributes to onnx's ArgMin operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) axis = int(attrs.get("axis")) keepdims = get_boolean_attribute_value(attrs, "keepdims") node = onnx.h...
[ "def", "convert_argmin", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "axis", "=", "int", "(", "attrs", ".", "get", "(", "\"axis\"", ")", ")", "keepdims"...
[ 1793, 0 ]
[ 1810, 17 ]
python
en
['en', 'en', 'en']
True
convert_maximum
(node, **kwargs)
Map MXNet's _maximum operator attributes to onnx's Max operator and return the created node.
Map MXNet's _maximum operator attributes to onnx's Max operator and return the created node.
def convert_maximum(node, **kwargs): """Map MXNet's _maximum operator attributes to onnx's Max operator and return the created node. """ return create_basic_op_node('Max', node, kwargs)
[ "def", "convert_maximum", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Max'", ",", "node", ",", "kwargs", ")" ]
[ 1813, 0 ]
[ 1817, 52 ]
python
en
['en', 'la', 'en']
True
convert_minimum
(node, **kwargs)
Map MXNet's _minimum operator attributes to onnx's Min operator and return the created node.
Map MXNet's _minimum operator attributes to onnx's Min operator and return the created node.
def convert_minimum(node, **kwargs): """Map MXNet's _minimum operator attributes to onnx's Min operator and return the created node. """ return create_basic_op_node('Min', node, kwargs)
[ "def", "convert_minimum", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Min'", ",", "node", ",", "kwargs", ")" ]
[ 1821, 0 ]
[ 1825, 52 ]
python
en
['en', 'mt', 'en']
True
convert_min
(node, **kwargs)
Map MXNet's min operator attributes to onnx's ReduceMin operator and return the created node.
Map MXNet's min operator attributes to onnx's ReduceMin operator and return the created node.
def convert_min(node, **kwargs): """Map MXNet's min operator attributes to onnx's ReduceMin operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) mx_axis = attrs.get("axis", None) axes = convert_string_to_list(str(mx_axis)) if mx_axis is not None else Non...
[ "def", "convert_min", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "mx_axis", "=", "attrs", ".", "get", "(", "\"axis\"", ",", "None", ")", "axes", "=", ...
[ 1828, 0 ]
[ 1859, 21 ]
python
en
['en', 'en', 'en']
True
convert_max
(node, **kwargs)
Map MXNet's max operator attributes to onnx's ReduceMax operator and return the created node.
Map MXNet's max operator attributes to onnx's ReduceMax operator and return the created node.
def convert_max(node, **kwargs): """Map MXNet's max operator attributes to onnx's ReduceMax operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) mx_axis = attrs.get("axis", None) axes = convert_string_to_list(str(mx_axis)) if mx_axis is not None else Non...
[ "def", "convert_max", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "mx_axis", "=", "attrs", ".", "get", "(", "\"axis\"", ",", "None", ")", "axes", "=", ...
[ 1863, 0 ]
[ 1894, 21 ]
python
en
['en', 'en', 'en']
True
convert_mean
(node, **kwargs)
Map MXNet's mean operator attributes to onnx's ReduceMean operator and return the created node.
Map MXNet's mean operator attributes to onnx's ReduceMean operator and return the created node.
def convert_mean(node, **kwargs): """Map MXNet's mean operator attributes to onnx's ReduceMean operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) mx_axis = attrs.get("axis", None) axes = convert_string_to_list(str(mx_axis)) if mx_axis is not None else ...
[ "def", "convert_mean", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "mx_axis", "=", "attrs", ".", "get", "(", "\"axis\"", ",", "None", ")", "axes", "=", ...
[ 1898, 0 ]
[ 1929, 21 ]
python
en
['en', 'en', 'en']
True
convert_prod
(node, **kwargs)
Map MXNet's prod operator attributes to onnx's ReduceProd operator and return the created node.
Map MXNet's prod operator attributes to onnx's ReduceProd operator and return the created node.
def convert_prod(node, **kwargs): """Map MXNet's prod operator attributes to onnx's ReduceProd operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) mx_axis = attrs.get("axis", None) axes = convert_string_to_list(str(mx_axis)) if mx_axis is not None else ...
[ "def", "convert_prod", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "mx_axis", "=", "attrs", ".", "get", "(", "\"axis\"", ",", "None", ")", "axes", "=", ...
[ 1933, 0 ]
[ 1964, 21 ]
python
en
['en', 'en', 'en']
True
convert_elementwise_add
(node, **kwargs)
Map MXNet's elemwise_add operator attributes to onnx's Add operator and return the created node.
Map MXNet's elemwise_add operator attributes to onnx's Add operator and return the created node.
def convert_elementwise_add(node, **kwargs): """Map MXNet's elemwise_add operator attributes to onnx's Add operator and return the created node. """ return create_basic_op_node('Add', node, kwargs)
[ "def", "convert_elementwise_add", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Add'", ",", "node", ",", "kwargs", ")" ]
[ 1969, 0 ]
[ 1973, 52 ]
python
en
['en', 'en', 'en']
True
covert_broadcast_add
(node, **kwargs)
Map MXNet's broadcast_add operator attributes to onnx's Add operator and return the created node.
Map MXNet's broadcast_add operator attributes to onnx's Add operator and return the created node.
def covert_broadcast_add(node, **kwargs): """Map MXNet's broadcast_add operator attributes to onnx's Add operator and return the created node. """ return create_basic_op_node('Add', node, kwargs)
[ "def", "covert_broadcast_add", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Add'", ",", "node", ",", "kwargs", ")" ]
[ 1977, 0 ]
[ 1981, 52 ]
python
en
['en', 'en', 'en']
True
convert_elementwise_sub
(node, **kwargs)
Map MXNet's elemwise_sub operator attributes to onnx's Sub operator and return the created node.
Map MXNet's elemwise_sub operator attributes to onnx's Sub operator and return the created node.
def convert_elementwise_sub(node, **kwargs): """Map MXNet's elemwise_sub operator attributes to onnx's Sub operator and return the created node. """ return create_basic_op_node('Sub', node, kwargs)
[ "def", "convert_elementwise_sub", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Sub'", ",", "node", ",", "kwargs", ")" ]
[ 1985, 0 ]
[ 1989, 52 ]
python
en
['en', 'en', 'en']
True
covert_broadcast_sub
(node, **kwargs)
Map MXNet's broadcast_sub operator attributes to onnx's Sub operator and return the created node.
Map MXNet's broadcast_sub operator attributes to onnx's Sub operator and return the created node.
def covert_broadcast_sub(node, **kwargs): """Map MXNet's broadcast_sub operator attributes to onnx's Sub operator and return the created node. """ return create_basic_op_node('Sub', node, kwargs)
[ "def", "covert_broadcast_sub", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Sub'", ",", "node", ",", "kwargs", ")" ]
[ 1992, 0 ]
[ 1996, 52 ]
python
en
['en', 'en', 'en']
True
convert_elemwise_mul
(node, **kwargs)
Map MXNet's elemwise_mul operator attributes to onnx's Mul operator and return the created node.
Map MXNet's elemwise_mul operator attributes to onnx's Mul operator and return the created node.
def convert_elemwise_mul(node, **kwargs): """Map MXNet's elemwise_mul operator attributes to onnx's Mul operator and return the created node. """ return create_basic_op_node('Mul', node, kwargs)
[ "def", "convert_elemwise_mul", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Mul'", ",", "node", ",", "kwargs", ")" ]
[ 1999, 0 ]
[ 2003, 52 ]
python
en
['en', 'en', 'en']
True
convert_broadcast_mul
(node, **kwargs)
Map MXNet's broadcast_mul operator attributes to onnx's Mul operator and return the created node.
Map MXNet's broadcast_mul operator attributes to onnx's Mul operator and return the created node.
def convert_broadcast_mul(node, **kwargs): """Map MXNet's broadcast_mul operator attributes to onnx's Mul operator and return the created node. """ return create_basic_op_node('Mul', node, kwargs)
[ "def", "convert_broadcast_mul", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Mul'", ",", "node", ",", "kwargs", ")" ]
[ 2006, 0 ]
[ 2010, 52 ]
python
en
['en', 'en', 'en']
True
convert_elemwise_div
(node, **kwargs)
Map MXNet's elemwise_div operator attributes to onnx's Div operator and return the created node.
Map MXNet's elemwise_div operator attributes to onnx's Div operator and return the created node.
def convert_elemwise_div(node, **kwargs): """Map MXNet's elemwise_div operator attributes to onnx's Div operator and return the created node. """ return create_basic_op_node('Div', node, kwargs)
[ "def", "convert_elemwise_div", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Div'", ",", "node", ",", "kwargs", ")" ]
[ 2013, 0 ]
[ 2017, 52 ]
python
en
['en', 'en', 'en']
True
convert_broadcast_div
(node, **kwargs)
Map MXNet's broadcast_div operator attributes to onnx's Div operator and return the created node.
Map MXNet's broadcast_div operator attributes to onnx's Div operator and return the created node.
def convert_broadcast_div(node, **kwargs): """Map MXNet's broadcast_div operator attributes to onnx's Div operator and return the created node. """ return create_basic_op_node('Div', node, kwargs)
[ "def", "convert_broadcast_div", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Div'", ",", "node", ",", "kwargs", ")" ]
[ 2020, 0 ]
[ 2024, 52 ]
python
en
['en', 'en', 'en']
True
convert_negative
(node, **kwargs)
Map MXNet's negative operator attributes to onnx's Neg operator and return the created node.
Map MXNet's negative operator attributes to onnx's Neg operator and return the created node.
def convert_negative(node, **kwargs): """Map MXNet's negative operator attributes to onnx's Neg operator and return the created node. """ return create_basic_op_node('Neg', node, kwargs)
[ "def", "convert_negative", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Neg'", ",", "node", ",", "kwargs", ")" ]
[ 2027, 0 ]
[ 2031, 52 ]
python
en
['en', 'en', 'en']
True
convert_abs
(node, **kwargs)
Map MXNet's abs operator attributes to onnx's Abs operator and return the created node.
Map MXNet's abs operator attributes to onnx's Abs operator and return the created node.
def convert_abs(node, **kwargs): """Map MXNet's abs operator attributes to onnx's Abs operator and return the created node. """ return create_basic_op_node('Abs', node, kwargs)
[ "def", "convert_abs", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Abs'", ",", "node", ",", "kwargs", ")" ]
[ 2034, 0 ]
[ 2038, 52 ]
python
en
['en', 'en', 'en']
True
convert_addn
(node, **kwargs)
Map MXNet's add_n operator attributes to onnx's Sum operator and return the created node.
Map MXNet's add_n operator attributes to onnx's Sum operator and return the created node.
def convert_addn(node, **kwargs): """Map MXNet's add_n operator attributes to onnx's Sum operator and return the created node. """ return create_basic_op_node('Sum', node, kwargs)
[ "def", "convert_addn", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Sum'", ",", "node", ",", "kwargs", ")" ]
[ 2041, 0 ]
[ 2045, 52 ]
python
en
['en', 'en', 'en']
True
convert_ceil
(node, **kwargs)
Map MXNet's ceil operator attributes to onnx's Ceil operator and return the created node.
Map MXNet's ceil operator attributes to onnx's Ceil operator and return the created node.
def convert_ceil(node, **kwargs): """Map MXNet's ceil operator attributes to onnx's Ceil operator and return the created node. """ return create_basic_op_node('Ceil', node, kwargs)
[ "def", "convert_ceil", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Ceil'", ",", "node", ",", "kwargs", ")" ]
[ 2049, 0 ]
[ 2053, 53 ]
python
en
['en', 'en', 'en']
True
convert_floor
(node, **kwargs)
Map MXNet's floor operator attributes to onnx's Floor operator and return the created node.
Map MXNet's floor operator attributes to onnx's Floor operator and return the created node.
def convert_floor(node, **kwargs): """Map MXNet's floor operator attributes to onnx's Floor operator and return the created node. """ return create_basic_op_node('Floor', node, kwargs)
[ "def", "convert_floor", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Floor'", ",", "node", ",", "kwargs", ")" ]
[ 2056, 0 ]
[ 2060, 54 ]
python
en
['en', 'nl', 'en']
True
convert_reshape
(node, **kwargs)
Map MXNet's Reshape operator attributes to onnx's Reshape operator. Converts output shape attribute to output shape tensor and return multiple created nodes.
Map MXNet's Reshape operator attributes to onnx's Reshape operator. Converts output shape attribute to output shape tensor and return multiple created nodes.
def convert_reshape(node, **kwargs): """Map MXNet's Reshape operator attributes to onnx's Reshape operator. Converts output shape attribute to output shape tensor and return multiple created nodes. """ name, input_nodes, attrs = get_inputs(node, kwargs) output_shape_list = convert_string_to_lis...
[ "def", "convert_reshape", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "output_shape_list", "=", "convert_string_to_list", "(", "attrs", "[", "\"shape\"", "]", ...
[ 2064, 0 ]
[ 2106, 38 ]
python
en
['en', 'en', 'en']
True
convert_cast
(node, **kwargs)
Map MXNet's Cast operator attributes to onnx's Cast operator and return the created node.
Map MXNet's Cast operator attributes to onnx's Cast operator and return the created node.
def convert_cast(node, **kwargs): """Map MXNet's Cast operator attributes to onnx's Cast operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) dtype = attrs["dtype"] # dtype can be mapped only with types from TensorProto # float32 is mapped to float ...
[ "def", "convert_cast", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "dtype", "=", "attrs", "[", "\"dtype\"", "]", "# dtype can be mapped only with types from Tenso...
[ 2109, 0 ]
[ 2132, 17 ]
python
en
['en', 'en', 'en']
True
convert_slice_axis
(node, **kwargs)
Map MXNet's slice_axis operator attributes to onnx's Slice operator and return the created node.
Map MXNet's slice_axis operator attributes to onnx's Slice operator and return the created node.
def convert_slice_axis(node, **kwargs): """Map MXNet's slice_axis operator attributes to onnx's Slice operator and return the created node. """ name, input_nodes, input_shapes, attrs = get_inputs(node, kwargs, with_shapes=True) axes = int(attrs.get("axis")) starts = int(attrs.get("begin")) ...
[ "def", "convert_slice_axis", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "input_shapes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ",", "with_shapes", "=", "True", ")", "axes", "=", "int", "(", "a...
[ 2136, 0 ]
[ 2178, 23 ]
python
en
['en', 'en', 'en']
True
convert_slice_channel
(node, **kwargs)
Map MXNet's SliceChannel operator attributes to onnx's Squeeze or Split operator based on squeeze_axis attribute and return the created node.
Map MXNet's SliceChannel operator attributes to onnx's Squeeze or Split operator based on squeeze_axis attribute and return the created node.
def convert_slice_channel(node, **kwargs): """Map MXNet's SliceChannel operator attributes to onnx's Squeeze or Split operator based on squeeze_axis attribute and return the created node. """ name, input_nodes, input_shapes, attrs = get_inputs(node, kwargs, with_shapes=True) num_outputs = int(a...
[ "def", "convert_slice_channel", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "input_shapes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ",", "with_shapes", "=", "True", ")", "num_outputs", "=", "int", ...
[ 2182, 0 ]
[ 2216, 74 ]
python
en
['en', 'en', 'en']
True
convert_expand_dims
(node, **kwargs)
Map MXNet's expand_dims operator attributes to onnx's Unsqueeze operator and return the created node.
Map MXNet's expand_dims operator attributes to onnx's Unsqueeze operator and return the created node.
def convert_expand_dims(node, **kwargs): """Map MXNet's expand_dims operator attributes to onnx's Unsqueeze operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) axis = int(attrs.get("axis")) node = onnx.helper.make_node( "Unsqueeze", inp...
[ "def", "convert_expand_dims", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "axis", "=", "int", "(", "attrs", ".", "get", "(", "\"axis\"", ")", ")", "node...
[ 2220, 0 ]
[ 2235, 17 ]
python
en
['en', 'en', 'en']
True
convert_squeeze
(node, **kwargs)
Map MXNet's squeeze operator attributes to onnx's squeeze operator and return the created node.
Map MXNet's squeeze operator attributes to onnx's squeeze operator and return the created node.
def convert_squeeze(node, **kwargs): """Map MXNet's squeeze operator attributes to onnx's squeeze operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) axis = attrs.get("axis", None) if not axis: raise AttributeError("Squeeze: Missing axis attribu...
[ "def", "convert_squeeze", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "axis", "=", "attrs", ".", "get", "(", "\"axis\"", ",", "None", ")", "if", "not", ...
[ 2238, 0 ]
[ 2257, 17 ]
python
en
['en', 'en', 'en']
True
convert_log
(node, **kwargs)
Map MXNet's log operator attributes to onnx's Log operator and return the created node.
Map MXNet's log operator attributes to onnx's Log operator and return the created node.
def convert_log(node, **kwargs): """Map MXNet's log operator attributes to onnx's Log operator and return the created node. """ return create_basic_op_node('Log', node, kwargs)
[ "def", "convert_log", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Log'", ",", "node", ",", "kwargs", ")" ]
[ 2261, 0 ]
[ 2265, 52 ]
python
en
['en', 'en', 'en']
True
convert_reciprocal
(node, **kwargs)
Map MXNet's reciprocal operator attributes to onnx's Reciprocal operator and return the created node.
Map MXNet's reciprocal operator attributes to onnx's Reciprocal operator and return the created node.
def convert_reciprocal(node, **kwargs): """Map MXNet's reciprocal operator attributes to onnx's Reciprocal operator and return the created node. """ return create_basic_op_node('Reciprocal', node, kwargs)
[ "def", "convert_reciprocal", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Reciprocal'", ",", "node", ",", "kwargs", ")" ]
[ 2268, 0 ]
[ 2272, 59 ]
python
en
['en', 'en', 'en']
True
convert_power
(node, **kwargs)
Map MXNet's _power operator attributes to onnx's Pow operator and return the created node.
Map MXNet's _power operator attributes to onnx's Pow operator and return the created node.
def convert_power(node, **kwargs): """Map MXNet's _power operator attributes to onnx's Pow operator and return the created node. """ return create_basic_op_node('Pow', node, kwargs)
[ "def", "convert_power", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Pow'", ",", "node", ",", "kwargs", ")" ]
[ 2275, 0 ]
[ 2279, 52 ]
python
en
['en', 'en', 'en']
True
convert_broadcast_power
(node, **kwargs)
Map MXNet's _power operator attributes to onnx's Pow operator and return the created node.
Map MXNet's _power operator attributes to onnx's Pow operator and return the created node.
def convert_broadcast_power(node, **kwargs): """Map MXNet's _power operator attributes to onnx's Pow operator and return the created node. """ return create_basic_op_node('Pow', node, kwargs)
[ "def", "convert_broadcast_power", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Pow'", ",", "node", ",", "kwargs", ")" ]
[ 2282, 0 ]
[ 2286, 52 ]
python
en
['en', 'en', 'en']
True
convert_sqrt
(node, **kwargs)
Map MXNet's sqrt operator attributes to onnx's Sqrt operator and return the created node.
Map MXNet's sqrt operator attributes to onnx's Sqrt operator and return the created node.
def convert_sqrt(node, **kwargs): """Map MXNet's sqrt operator attributes to onnx's Sqrt operator and return the created node. """ return create_basic_op_node('Sqrt', node, kwargs)
[ "def", "convert_sqrt", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Sqrt'", ",", "node", ",", "kwargs", ")" ]
[ 2289, 0 ]
[ 2293, 53 ]
python
en
['en', 'mt', 'en']
True
convert_depthtospace
(node, **kwargs)
Map MXNet's depth_to_space operator attributes to onnx's DepthToSpace operator and return the created node.
Map MXNet's depth_to_space operator attributes to onnx's DepthToSpace operator and return the created node.
def convert_depthtospace(node, **kwargs): """Map MXNet's depth_to_space operator attributes to onnx's DepthToSpace operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) blksize = int(attrs.get("block_size", 0)) node = onnx.helper.make_node( "Dept...
[ "def", "convert_depthtospace", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "blksize", "=", "int", "(", "attrs", ".", "get", "(", "\"block_size\"", ",", "0...
[ 2296, 0 ]
[ 2311, 17 ]
python
en
['en', 'en', 'en']
True
convert_spacetodepth
(node, **kwargs)
Map MXNet's space_to_depth operator attributes to onnx's SpaceToDepth operator and return the created node.
Map MXNet's space_to_depth operator attributes to onnx's SpaceToDepth operator and return the created node.
def convert_spacetodepth(node, **kwargs): """Map MXNet's space_to_depth operator attributes to onnx's SpaceToDepth operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) blksize = int(attrs.get("block_size", 0)) node = onnx.helper.make_node( "Spac...
[ "def", "convert_spacetodepth", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "blksize", "=", "int", "(", "attrs", ".", "get", "(", "\"block_size\"", ",", "0...
[ 2314, 0 ]
[ 2329, 17 ]
python
en
['en', 'en', 'en']
True
convert_square
(node, **kwargs)
Map MXNet's square operator attributes to onnx's Pow operator and return the created node.
Map MXNet's square operator attributes to onnx's Pow operator and return the created node.
def convert_square(node, **kwargs): """Map MXNet's square operator attributes to onnx's Pow operator and return the created node. """ name, input_nodes, _ = get_inputs(node, kwargs) initializer = kwargs["initializer"] data_type = onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[np.dtype('int64')] power...
[ "def", "convert_square", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "_", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "initializer", "=", "kwargs", "[", "\"initializer\"", "]", "data_type", "=", "onnx", ".", ...
[ 2332, 0 ]
[ 2361, 30 ]
python
en
['en', 'en', 'en']
True
convert_sum
(node, **kwargs)
Map MXNet's sum operator attributes to onnx's ReduceSum operator and return the created node.
Map MXNet's sum operator attributes to onnx's ReduceSum operator and return the created node.
def convert_sum(node, **kwargs): """Map MXNet's sum operator attributes to onnx's ReduceSum operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) mx_axis = attrs.get("axis", None) axes = convert_string_to_list(str(mx_axis)) if mx_axis is not None else Non...
[ "def", "convert_sum", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "mx_axis", "=", "attrs", ".", "get", "(", "\"axis\"", ",", "None", ")", "axes", "=", ...
[ 2364, 0 ]
[ 2392, 17 ]
python
en
['en', 'la', 'en']
True
convert_shape
(node, **kwargs)
Map MXNet's shape_array operator attributes to onnx's Shape operator and return the created node.
Map MXNet's shape_array operator attributes to onnx's Shape operator and return the created node.
def convert_shape(node, **kwargs): """Map MXNet's shape_array operator attributes to onnx's Shape operator and return the created node. """ return create_basic_op_node('Shape', node, kwargs)
[ "def", "convert_shape", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Shape'", ",", "node", ",", "kwargs", ")" ]
[ 2396, 0 ]
[ 2400, 54 ]
python
en
['en', 'en', 'en']
True
convert_hardsigmoid
(node, **kwargs)
Map MXNet's hard_sigmoid operator attributes to onnx's HardSigmoid operator and return the created node.
Map MXNet's hard_sigmoid operator attributes to onnx's HardSigmoid operator and return the created node.
def convert_hardsigmoid(node, **kwargs): """Map MXNet's hard_sigmoid operator attributes to onnx's HardSigmoid operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) # Converting to float32 alpha = float(attrs.get("alpha", 0.2)) beta = float(attrs.get(...
[ "def", "convert_hardsigmoid", "(", "node", ",", "*", "*", "kwargs", ")", ":", "name", ",", "input_nodes", ",", "attrs", "=", "get_inputs", "(", "node", ",", "kwargs", ")", "# Converting to float32", "alpha", "=", "float", "(", "attrs", ".", "get", "(", "...
[ 2404, 0 ]
[ 2422, 17 ]
python
en
['en', 'fi', 'en']
True
convert_broadcast_lesser
(node, **kwargs)
Map MXNet's broadcast_lesser operator attributes to onnx's Less operator and return the created node.
Map MXNet's broadcast_lesser operator attributes to onnx's Less operator and return the created node.
def convert_broadcast_lesser(node, **kwargs): """Map MXNet's broadcast_lesser operator attributes to onnx's Less operator and return the created node. """ return create_basic_op_node('Less', node, kwargs)
[ "def", "convert_broadcast_lesser", "(", "node", ",", "*", "*", "kwargs", ")", ":", "return", "create_basic_op_node", "(", "'Less'", ",", "node", ",", "kwargs", ")" ]
[ 2425, 0 ]
[ 2429, 53 ]
python
en
['en', 'en', 'en']
True