query stringlengths 9 9.05k | document stringlengths 10 222k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 4 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
The function is meant to make use of the sqoop export functionality to export data from hive to mysql db. | def hive_to_mysql(hive_conn, username, password, host, port, export_dir,
table_name):
# the input fields terminated by parameter is to specify
os.system("sqoop export --connect jdbc:mysql://{0}:{1}/hive --username " \
"{2} --password {3} --table {4} --export-dir {5} --input-fields-terminated-... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def main(dest_dir, db_host, db_port, db_name, db_schema, db_username, db_password, ssl_mode,\n force, cores, memory_per_core, default_partition_col, partition_col,\n nr_partitions):\n partition_col_dict = {k: v for k, v in partition_col}\n nr_partitions_dict = {k: v for k, v in nr_partitions}... | [
"0.6315057",
"0.6245598",
"0.6017175",
"0.5787101",
"0.5758232",
"0.573403",
"0.56615156",
"0.5621154",
"0.5613762",
"0.56111676",
"0.55346966",
"0.55025053",
"0.54620385",
"0.5452798",
"0.5428737",
"0.5426115",
"0.54060113",
"0.5380885",
"0.5377392",
"0.5359161",
"0.5295265"... | 0.78318924 | 0 |
Create new map item | def create(self, mapItem: MapItem) -> int:
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_map(self):\n self.wizard = NewMap(self)",
"def add(self, item):\n self._dict[item] = item",
"def add_map(new_prot, new_target, map_path, map_type):\n hotspot_map = HotspotMap.objects.get_or_create(\n map_type=map_type, target_id=new_target, prot_id=new_prot\n )[0]\n hotspot_ma... | [
"0.663403",
"0.6446372",
"0.62781554",
"0.61970216",
"0.618926",
"0.6137825",
"0.6078885",
"0.5993192",
"0.5991251",
"0.5985686",
"0.59658325",
"0.5953617",
"0.59227896",
"0.590874",
"0.58784914",
"0.58716595",
"0.5857414",
"0.5817465",
"0.5817132",
"0.5809343",
"0.580722",
... | 0.7733658 | 0 |
Update map item in database | def update(self, mapItem: MapItem):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_item(self, table, item):",
"def update(self, mapper_info: dict):\n self.update_from_dict(\n [\n \"form_id\",\n \"form_name\",\n \"form_revision_number\",\n \"process_key\",\n \"process_name\",\n ... | [
"0.6819395",
"0.6547382",
"0.6486562",
"0.64180374",
"0.6259836",
"0.6173413",
"0.61376715",
"0.6136338",
"0.6133015",
"0.6133015",
"0.61063683",
"0.6041662",
"0.59641296",
"0.5876489",
"0.5864035",
"0.58607227",
"0.5849195",
"0.58311784",
"0.58310145",
"0.5828876",
"0.581150... | 0.77123857 | 0 |
Delete Map item from database and all his translates | def delete(self, mapitem_id: int):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete():\n\t# Create session\n\ts = Session()\n\ts.query(Lookup).delete(synchronize_session=False)\n\ts.commit()",
"def test_delete_saved_app_map_search(self):\n pass",
"def delete(self, key):\n app.logger.info('Request to Delete a map_object with key [%s]', key)\n map_object = Map.ge... | [
"0.60695505",
"0.60244024",
"0.5943307",
"0.58938456",
"0.5815377",
"0.58143026",
"0.57671386",
"0.5745031",
"0.57079214",
"0.57064176",
"0.569948",
"0.5697754",
"0.5660007",
"0.56400824",
"0.5629807",
"0.56289786",
"0.5627679",
"0.56257826",
"0.56040335",
"0.5601899",
"0.559... | 0.7070288 | 0 |
Get map item from database | def get(self, mapitem_id: int) -> MapItem:
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mapdata():\n return getmapdata(db, MyTable)",
"def get_db_item(self, key, item_key):\n return self.get_db_items(key).get(item_key)",
"def get_map_item(self, idx, col=0, absolute=False):\n\n return self.itemDataMap[self.itemIndexMap[idx] if not absolute else idx][self.get_real_col(col)]",
... | [
"0.6950481",
"0.6852836",
"0.65755594",
"0.65000963",
"0.64465505",
"0.6368746",
"0.6318184",
"0.6285017",
"0.62202585",
"0.61964667",
"0.61231244",
"0.605938",
"0.604496",
"0.60364556",
"0.60216033",
"0.5915674",
"0.591564",
"0.5902572",
"0.58843106",
"0.5884206",
"0.5880697... | 0.74543875 | 0 |
Get list of map items for selected lang | def get_all(self, lang: str = None):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_item_concept_mapping(self, lang):\n concepts = self.filter(active=True, lang=lang)\n return group_keys_by_value_lists(Concept.objects.get_concept_item_mapping(concepts, lang))",
"def get_langs(id):",
"def list(self):\n for key, value in self.languages.iteritems():\n prin... | [
"0.6933556",
"0.6791755",
"0.6202333",
"0.60564715",
"0.6018329",
"0.59928876",
"0.59139585",
"0.58982617",
"0.58469373",
"0.5843785",
"0.5796447",
"0.57480514",
"0.57101274",
"0.5703919",
"0.5663914",
"0.5649781",
"0.5592568",
"0.55881494",
"0.55463994",
"0.5546072",
"0.5523... | 0.6805568 | 1 |
Test an execution plan with downloadable git files | def test_execution_plan_type_downloable_git(self, mock_makedir, mock_path,
mock_git):
mock_makedir.return_value = None
mock_path.return_value = True
mock_git.clone.return_value = None
template = self.get_template_downloable_git()
fi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_download_deployment_run_test_report(self):\n pass",
"def test_download_file(token):\n\n # github => repo => release => asset_list => asset => url => download\n\n g_h = github.Github(token, per_page=100)\n repo = g_h.get_repo(TEST_SLUG, lazy=False)\n release = repo.get_release(TEST_TAG... | [
"0.65409565",
"0.6530164",
"0.6279986",
"0.6256195",
"0.6231449",
"0.6157987",
"0.6156309",
"0.61558706",
"0.61408335",
"0.60977995",
"0.604785",
"0.594729",
"0.5861912",
"0.5824399",
"0.57773626",
"0.5769683",
"0.57622266",
"0.5680721",
"0.5665056",
"0.5652566",
"0.5651526",... | 0.6872425 | 0 |
Test an execution plan with svn files. | def test_execution_plan_type_svn(self, mock_makedir, mock_subproc_popen):
process_mock = mock.Mock()
attrs = {'communicate.return_value': ('ouput', 'ok'),
'poll.return_value': 0}
process_mock.configure_mock(**attrs)
mock_subproc_popen.return_value = process_mock
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_file_with_svn_and_revision(self):\n self._test_get_file(\n tool_name='Subversion',\n revision='123',\n base_commit_id=None,\n expected_revision='123')",
"def test_get_file_with_svn_and_base_commit_id(self):\n self._test_get_file(\n ... | [
"0.60671014",
"0.59154356",
"0.5870971",
"0.57437944",
"0.56704193",
"0.56515604",
"0.5607383",
"0.5580017",
"0.55432963",
"0.55121726",
"0.55041003",
"0.5493844",
"0.5489692",
"0.54305446",
"0.5429826",
"0.5413528",
"0.5403241",
"0.53945506",
"0.5375887",
"0.53562385",
"0.53... | 0.75792676 | 0 |
Helper function to convert padding format for pad operator. | 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(num_pad_values/2)
for idx in range(0, num_pad_values):
if idx % 2 == 0:
onnx_pad_width[start_in... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_padding(g, op, block):\n\n input_x = g.get_node(op.input(\"X\")[0])\n input_padding = op.input(\"Paddings\")\n if input_padding:\n padding = g.get_node(input_padding[0])\n padding = infer_value(padding, g.get_params()).numpy().tolist()\n else:\n padding = op.attr(\"padd... | [
"0.68323696",
"0.6653805",
"0.6588574",
"0.6539116",
"0.6471568",
"0.6465333",
"0.64627033",
"0.6430866",
"0.63953453",
"0.63670754",
"0.6362064",
"0.6358119",
"0.63537",
"0.63283384",
"0.63223386",
"0.6321739",
"0.6320306",
"0.6287044",
"0.62865645",
"0.62791353",
"0.6271379... | 0.68918765 | 0 |
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):
return 1 if attrs.get(attr_name, 0) in ["True", "1"] else 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_to_intbool(val_str):\n return 1 if val_str == 'Yes' else 0",
"def int_from_bool_as_string(subject):\r\n return bool_from_string(subject) and 1 or 0",
"def _bool_to_int(self, bool_arg):\n if bool_arg == True:\n return 1\n else:\n return 0",
"def bool_attr(... | [
"0.64697516",
"0.64594436",
"0.62451714",
"0.6019205",
"0.6004195",
"0.599485",
"0.5975256",
"0.59653413",
"0.5840328",
"0.5804822",
"0.56859833",
"0.56824034",
"0.5662187",
"0.5627271",
"0.5594165",
"0.5585451",
"0.5547492",
"0.5395261",
"0.53894955",
"0.53652155",
"0.536489... | 0.6708033 | 0 |
Helper function to create a basic operator node that doesn't contain op specific attrs | def create_basic_op_node(op_name, node, kwargs):
name, input_nodes, _ = get_inputs(node, kwargs)
node = onnx.helper.make_node(
op_name,
input_nodes,
[name],
name=name
)
return [node] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_concat(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n\n node.attribute.extend([\n helper.make_attribute('axis', op.axis),\n ])\n return node",
"def op(self) -> Literal[\"==\"] | Literal[\"<=\"] | Literal[\">=\"]:\n ...",
"def... | [
"0.63253284",
"0.632039",
"0.62180704",
"0.62112194",
"0.6123615",
"0.61039203",
"0.61005336",
"0.6060044",
"0.600828",
"0.6002395",
"0.60003734",
"0.595907",
"0.5952342",
"0.5919387",
"0.59105414",
"0.5905878",
"0.589422",
"0.58619446",
"0.58419603",
"0.58360064",
"0.5822752... | 0.7472675 | 0 |
Helper function to convert weights and inputs. | def convert_weights_and_inputs(node, **kwargs):
name, _, _ = get_inputs(node, kwargs)
if kwargs["is_input"] is False:
weights = kwargs["weights"]
initializer = kwargs["initializer"]
np_arr = weights[name]
data_type = onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[np_arr.dtype]
dims... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _input(self, inputs):\n return sum([w*i for w,i in zip(self._weights, inputs)])",
"def normalize_input(inputs: [float]) -> [float]:",
"def inputs_weights_init(self):\n input_user, input_item, input_rating = self.inputs_init()\n user_embeddings, item_embeddings = self.embeddings_layers_... | [
"0.68360084",
"0.64592713",
"0.6424411",
"0.6227467",
"0.6222293",
"0.61991525",
"0.618634",
"0.61317295",
"0.61289394",
"0.6118224",
"0.6114964",
"0.6105876",
"0.6105316",
"0.60550016",
"0.6040807",
"0.6006805",
"0.60003716",
"0.5966255",
"0.5961394",
"0.59462756",
"0.592056... | 0.7170687 | 0 |
Map MXNet's convolution operator attributes to onnx's Conv operator and return the created node. | def convert_convolution(node, **kwargs):
name, input_nodes, attrs = get_inputs(node, kwargs)
kernel_dims = list(parse_helper(attrs, "kernel"))
stride_dims = list(parse_helper(attrs, "stride", [1, 1]))
pad_dims = list(parse_helper(attrs, "pad", [0, 0]))
num_group = int(attrs.get("num_group", 1))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_conv_pool(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n\n k = [op.handle.kernel_h, op.handle.kernel_w]\n s = [op.handle.stride_h, op.handle.stride_w]\n oddp = op.odd_padding\n p = [\n op.handle.pad_h + oddp[0],\n op.h... | [
"0.69920486",
"0.66528916",
"0.6432573",
"0.59314674",
"0.59063995",
"0.5811342",
"0.5794324",
"0.57784176",
"0.57155585",
"0.5674647",
"0.5611912",
"0.5560294",
"0.552098",
"0.5466808",
"0.5450267",
"0.54139715",
"0.5381454",
"0.538118",
"0.53697866",
"0.5363581",
"0.5358975... | 0.7379639 | 0 |
Map MXNet's deconvolution operator attributes to onnx's ConvTranspose operator and return the created node. | def convert_deconvolution(node, **kwargs):
name, inputs, attrs = get_inputs(node, kwargs)
kernel_dims = list(parse_helper(attrs, "kernel"))
stride_dims = list(parse_helper(attrs, "stride", [1, 1]))
pad_dims = list(parse_helper(attrs, "pad", [0, 0]))
num_group = int(attrs.get("num_group", 1))
di... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_transpose(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n\n node.attribute.extend([\n helper.make_attribute('perm', op.perm),\n ])\n return node",
"def deconv(inp):\n num_filters = inp.get_shape().as_list()[-1]\n\n x = Conv2DTran... | [
"0.6097374",
"0.601943",
"0.58937025",
"0.58428407",
"0.57710683",
"0.5762493",
"0.56841415",
"0.55704516",
"0.55147016",
"0.55106026",
"0.5437586",
"0.5421498",
"0.53722894",
"0.53698725",
"0.53527224",
"0.5335422",
"0.5334541",
"0.53216076",
"0.5319174",
"0.5318343",
"0.530... | 0.790625 | 0 |
Map MXNet's crop operator attributes to onnx's Crop operator and return the created node. | def convert_crop(node, **kwargs):
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_tensor_node(start, name + '__starts', kwargs)
export_nodes.extend(start_node)
start_node = start_node[-1].... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_clip(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n if op.min is not None:\n node.input.append(op.name + \":min\")\n else:\n node.input.append(\"\")\n if op.max is not None:\n node.input.append(op.name + \":max\")\... | [
"0.5632038",
"0.55095476",
"0.5424357",
"0.5367828",
"0.5309837",
"0.5078018",
"0.5071087",
"0.49778563",
"0.49666363",
"0.491709",
"0.4914572",
"0.49061403",
"0.49024212",
"0.4902058",
"0.4891922",
"0.48729894",
"0.48681563",
"0.4843361",
"0.4805982",
"0.47791198",
"0.475751... | 0.63828367 | 0 |
Map MXNet's UpSampling operator attributes to onnx's Upsample operator and return the created node. | def convert_upsample(node, **kwargs):
name, input_nodes, attrs = get_inputs(node, kwargs)
sample_type = attrs.get('sample_type', 'nearest')
sample_type = 'linear' if sample_type == 'bilinear' else sample_type
scale = convert_string_to_list(attrs.get('scale'))
scaleh = scalew = float(scale[0])
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_upsample_layer(self, in_channels=None, out_channels=None):\n if self.expand_strategy == \"upsample\":\n return nn.Upsample(scale_factor=2, mode=\"nearest\")\n elif self.expand_strategy == \"transpose_convolution\":\n return nn.ConvTranspose2d(\n in_channe... | [
"0.5554982",
"0.5521366",
"0.54900855",
"0.5459652",
"0.5323029",
"0.5225662",
"0.5160975",
"0.51450866",
"0.5143616",
"0.5027456",
"0.5023463",
"0.49990726",
"0.49227133",
"0.48704767",
"0.48497036",
"0.48493198",
"0.48339114",
"0.47982448",
"0.47692373",
"0.4767733",
"0.475... | 0.64564914 | 0 |
Map MXNet's FullyConnected operator attributes to onnx's Gemm operator and return the created node. | def convert_fully_connected(node, **kwargs):
name, input_nodes, attrs = get_inputs(node, kwargs)
initializer = kwargs["initializer"]
no_bias = get_boolean_attribute_value(attrs, "no_bias")
fcnode = []
op_name = "flatten_" + str(kwargs["idx"])
flatten_node = onnx.helper.make_node(
'Fl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_gemm(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n\n node.attribute.extend([\n helper.make_attribute('alpha', float(op.alpha)),\n helper.make_attribute('beta', float(op.beta)),\n helper.make_attribute('transA', op.transA),\n ... | [
"0.6879449",
"0.5942417",
"0.58318627",
"0.5746459",
"0.5413726",
"0.53791827",
"0.5367006",
"0.5331266",
"0.527826",
"0.5257274",
"0.52468914",
"0.5242588",
"0.5240532",
"0.51549006",
"0.515457",
"0.51430964",
"0.5114177",
"0.5093029",
"0.50854313",
"0.5052347",
"0.50358003"... | 0.5959116 | 1 |
Map MXNet's BatchNorm operator attributes to onnx's BatchNormalization operator and return the created node. | def convert_batchnorm(node, **kwargs):
name, input_nodes, attrs = get_inputs(node, kwargs)
momentum = float(attrs.get("momentum", 0.9))
eps = float(attrs.get("eps", 0.001))
bn_node = onnx.helper.make_node(
"BatchNormalization",
input_nodes,
[name],
name=name,
ep... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_batchnorm(cls, op, op_t):\n # first, we init batchnorm node\n epsilon = 1e-5 # the epsilon value used in singa\n bn_node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n bn_node.attribute.extend([\n helper.make_attribute('momentum', op.handle.factor),\n ... | [
"0.6464468",
"0.6376962",
"0.61264753",
"0.5883445",
"0.57059985",
"0.57012653",
"0.56393033",
"0.5572092",
"0.55718195",
"0.551708",
"0.54826975",
"0.5470176",
"0.5425131",
"0.5422429",
"0.54030514",
"0.5381643",
"0.5354029",
"0.5310859",
"0.52805203",
"0.5256326",
"0.522801... | 0.7146321 | 0 |
Map MXNet's tanh operator attributes to onnx's Tanh operator and return the created node. | def convert_tanh(node, **kwargs):
return create_basic_op_node('Tanh', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tanh(self):\n return type(self)(self.parent(),\n self._simplify(self._express.tanh()))",
"def _create_hardsigmoid(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n\n node.attribute.extend([\n helper.make_attribute('alpha', op.a... | [
"0.66637284",
"0.66221046",
"0.6183689",
"0.6041877",
"0.6009536",
"0.60078925",
"0.6001827",
"0.59675324",
"0.59085935",
"0.5895642",
"0.5892149",
"0.58851",
"0.5857893",
"0.5766065",
"0.5756888",
"0.5718928",
"0.56849617",
"0.5675731",
"0.56675726",
"0.566487",
"0.5653042",... | 0.7406357 | 0 |
Map MXNet's cos operator attributes to onnx's Cos operator and return the created node. | def convert_cos(node, **kwargs):
return create_basic_op_node('Cos', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cos(self):\n return type(self)(self.parent(),\n self._simplify(self._express.cos()))",
"def convert_acos(node, **kwargs):\n return create_basic_op_node('Acos', node, kwargs)",
"def cos(obj):\n\tif isinstance(obj, Variable):\n\t\tval = np.cos(obj.val)\n\t\tder = -np.sin(ob... | [
"0.68186814",
"0.64716417",
"0.6203887",
"0.6197016",
"0.6076361",
"0.60689795",
"0.6031383",
"0.5917666",
"0.5856112",
"0.5803058",
"0.5774136",
"0.57586396",
"0.5689945",
"0.56162506",
"0.56064403",
"0.5498463",
"0.5487711",
"0.5412239",
"0.53912306",
"0.53586626",
"0.53557... | 0.77887577 | 0 |
Map MXNet's sin operator attributes to onnx's Sin operator and return the created node. | def convert_sin(node, **kwargs):
return create_basic_op_node('Sin', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sin(self):\n return type(self)(self.parent(),\n self._simplify(self._express.sin()))",
"def sin(obj):\n\tif isinstance(obj, Variable):\n\t\tval = np.sin(obj.val)\n\t\tder = np.cos(obj.val)\n\t\tif len(obj.der.shape)>len(der.shape):\n\t\t\tder = np.expand_dims(der,1)\n\t\tder =... | [
"0.6925629",
"0.63005567",
"0.62578577",
"0.6207433",
"0.60740703",
"0.5979021",
"0.5886588",
"0.5854158",
"0.5850431",
"0.58287054",
"0.57712215",
"0.5768085",
"0.57123333",
"0.56800777",
"0.55576193",
"0.54214805",
"0.54193765",
"0.5405628",
"0.53958225",
"0.53906035",
"0.5... | 0.7659397 | 0 |
Map MXNet's tan operator attributes to onnx's tan operator and return the created node. | def convert_tan(node, **kwargs):
return create_basic_op_node('Tan', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_tanh(node, **kwargs):\n return create_basic_op_node('Tanh', node, kwargs)",
"def tan(self):\n return type(self)(self.parent(),\n self._simplify(self._express.tan()))",
"def tan(obj):\n\tif isinstance(obj, Variable):\n\t\tval = np.tan(obj.val)\n\t\tder = 1+np.tan(o... | [
"0.7066365",
"0.69418204",
"0.62932664",
"0.6291011",
"0.6098471",
"0.6070739",
"0.60638016",
"0.6008856",
"0.595648",
"0.5951899",
"0.581182",
"0.57857805",
"0.57706344",
"0.5729434",
"0.5726495",
"0.5701578",
"0.56677294",
"0.5623807",
"0.56201595",
"0.560823",
"0.5586857",... | 0.760391 | 0 |
Map MXNet's acos operator attributes to onnx's acos operator and return the created node. | def convert_acos(node, **kwargs):
return create_basic_op_node('Acos', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_cos(node, **kwargs):\n return create_basic_op_node('Cos', node, kwargs)",
"def create_dot1p_to_cos_mapping(self, ports, rx_attr_flag=False, **kwargs):\n pass",
"def arccos(self):\n return type(self)(self.parent(),\n self._simplify(self._express.arccos()))",... | [
"0.66714954",
"0.5832328",
"0.5820055",
"0.54579884",
"0.5427718",
"0.54265505",
"0.5377508",
"0.5375877",
"0.5216904",
"0.5200265",
"0.5194074",
"0.51886547",
"0.51454943",
"0.50762826",
"0.50367916",
"0.50269526",
"0.50130564",
"0.50080115",
"0.498638",
"0.49777353",
"0.497... | 0.72537535 | 0 |
Map MXNet's asin operator attributes to onnx's asin operator and return the created node. | def convert_asin(node, **kwargs):
return create_basic_op_node('Asin', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _onnx_node_to_singa_op(cls,\n onnx_node,\n inputs,\n opset_version=_known_opset_version):\n if onnx_node.op_type in cls._special_operators:\n translator = getattr(cls, cls._special_operators[onnx_node.op... | [
"0.5615745",
"0.5525026",
"0.5475919",
"0.5348382",
"0.52133733",
"0.512875",
"0.5086857",
"0.50501585",
"0.49973157",
"0.49967095",
"0.49640378",
"0.49598986",
"0.49447057",
"0.49313256",
"0.49242523",
"0.4889783",
"0.48892346",
"0.48825702",
"0.4869105",
"0.48690882",
"0.48... | 0.68138564 | 0 |
Map MXNet's atan operator attributes to onnx's atan operator and return the created node. | def convert_atan(node, **kwargs):
return create_basic_op_node('Atan', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_acos(node, **kwargs):\n return create_basic_op_node('Acos', node, kwargs)",
"def atan (cls, x) :\n return Angle_R (math.atan (x))",
"def convert_tan(node, **kwargs):\n return create_basic_op_node('Tan', node, kwargs)",
"def convert_asin(node, **kwargs):\n return create_basic_op_no... | [
"0.65847087",
"0.6237189",
"0.6214043",
"0.60928404",
"0.6050979",
"0.5992298",
"0.5854942",
"0.5778332",
"0.5749585",
"0.5689177",
"0.56575197",
"0.5505356",
"0.5486537",
"0.5469867",
"0.54422086",
"0.5406414",
"0.5399801",
"0.5374126",
"0.5345535",
"0.5344025",
"0.53360784"... | 0.78846675 | 0 |
Map MXNet's sigmoid operator attributes to onnx's Sigmoid operator and return the created node. | def convert_sigmoid(node, **kwargs):
return create_basic_op_node('Sigmoid', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_hardsigmoid(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n\n node.attribute.extend([\n helper.make_attribute('alpha', op.alpha),\n helper.make_attribute('beta', op.gamma),\n ])\n return node",
"def _create_hardsigmoid(cls, ... | [
"0.7370613",
"0.7041682",
"0.6546022",
"0.648128",
"0.6382078",
"0.6377375",
"0.6302575",
"0.6283234",
"0.6230437",
"0.6167952",
"0.6156127",
"0.60304093",
"0.59833264",
"0.5979358",
"0.5970586",
"0.593866",
"0.59101063",
"0.5903408",
"0.5903408",
"0.5856696",
"0.58536077",
... | 0.7811297 | 0 |
Map MXNet's relu operator attributes to onnx's Relu operator and return the created node. | def convert_relu(node, **kwargs):
return create_basic_op_node('Relu', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_elu(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n\n node.attribute.extend([\n helper.make_attribute('alpha', op.alpha),\n ])\n return node",
"def relu(input, inplace=False):\n return FunctionLib.apply(\n 'Relu', input.devic... | [
"0.6200267",
"0.60108554",
"0.57318294",
"0.57223237",
"0.55151415",
"0.5508822",
"0.55065703",
"0.5483933",
"0.5419298",
"0.5369124",
"0.53125054",
"0.52744555",
"0.52538085",
"0.5234616",
"0.5223587",
"0.52179486",
"0.51698667",
"0.51464564",
"0.51462084",
"0.51363164",
"0.... | 0.7071261 | 0 |
Map MXNet's Activation operator attributes to onnx's Tanh/Relu operator and return the created node. | def convert_activation(node, **kwargs):
name, input_nodes, attrs = get_inputs(node, kwargs)
act_type = attrs["act_type"]
# Creating a dictionary here, but if this titlecase pattern
# mxnet_name.title()
act_types = {
"tanh": "Tanh",
"relu": "Relu",
"sigmoid": "Sigmoid",
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_elu(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n\n node.attribute.extend([\n helper.make_attribute('alpha', op.alpha),\n ])\n return node",
"def _create_gemm(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, ... | [
"0.6525348",
"0.6170288",
"0.6057955",
"0.583563",
"0.5773526",
"0.5732154",
"0.55703044",
"0.5537313",
"0.54962003",
"0.5491791",
"0.54823685",
"0.548114",
"0.54719126",
"0.54137206",
"0.5379066",
"0.53318",
"0.5318398",
"0.53031856",
"0.5283017",
"0.52783245",
"0.5272741",
... | 0.6768296 | 0 |
Map MXNet's pad operator attributes to onnx's Pad operator and return the created node. | def convert_pad(node, **kwargs):
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)
pad_mode = attrs.get("mode")
if pad_mode == "constant":
pad_value = float(attrs.get("co... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_pads(onnx_node): # type: (NodeWrapper) -> Tuple[int, int, int]\n auto_pad = onnx_node.get_attribute_value('auto_pad')\n pads = onnx_node.get_attribute_value('pads', ()) # Padding along each axis\n kernel_shape = onnx_node.get_attribute_value('kernel_shape')\n\n # Attribute 'auto_pad' is depre... | [
"0.57889557",
"0.5579466",
"0.54904",
"0.5398082",
"0.52853227",
"0.5275017",
"0.5262226",
"0.52524114",
"0.51949155",
"0.51621807",
"0.5159108",
"0.508906",
"0.50823164",
"0.5075376",
"0.5003475",
"0.49345222",
"0.49055016",
"0.49049303",
"0.49036154",
"0.4897707",
"0.488882... | 0.7317738 | 0 |
create extra tensor node from numpy values | 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.make_tensor_value_info(
name=output_name,
elem_type=data_type,
shape=input_vals.shape
)
kwargs["initializer"].append(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_constant(cls, onnx_node, inputs, opset_version):\n tmp_tensor = onnx_node.getattr('value')\n np_dtype = onnx.mapping.TENSOR_TYPE_TO_NP_TYPE[tmp_tensor.data_type]\n np_tensor = np.frombuffer(tmp_tensor.raw_data, dtype=np_dtype)\n if np_tensor.dtype == \"int64\":\n ... | [
"0.6670378",
"0.6648633",
"0.63642025",
"0.62701637",
"0.6126209",
"0.61022186",
"0.6095189",
"0.60797447",
"0.6028599",
"0.6016147",
"0.6001126",
"0.59771246",
"0.59069496",
"0.5865564",
"0.5849665",
"0.58315593",
"0.5821287",
"0.57957333",
"0.57812244",
"0.57678527",
"0.572... | 0.68433195 | 0 |
create extra reshape node with static shape | def create_helper_reshape_node(input_name, output_name, shape, kwargs):
shape_tensor_node, = create_helper_tensor_node(
np.asarray(shape, dtype=np.int64), output_name + "__shape", kwargs
)
reshape_node = onnx.helper.make_node(
"Reshape",
inputs=[input_name, shape_tensor_node.name],
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_reshape(cls, op, op_t):\n # make the shape node\n # because the reshape in singa does not provide its shape as input tensor\n shape_node_name = op.name + \":shape\"\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n node.input.extend([shape_node_name])\n ... | [
"0.78215057",
"0.7107456",
"0.69461006",
"0.67939496",
"0.6732763",
"0.6498097",
"0.6490464",
"0.6484981",
"0.6472887",
"0.6448186",
"0.6354322",
"0.6187885",
"0.61778134",
"0.6151803",
"0.613624",
"0.61251277",
"0.6119176",
"0.61077476",
"0.6069696",
"0.60536623",
"0.6050781... | 0.736639 | 1 |
create extra concat node | def create_helper_concat_node(inputs, output_name, axis=0):
concat_node = onnx.helper.make_node(
"Concat",
inputs=inputs,
outputs=[output_name],
name=output_name,
axis=axis,
)
return [concat_node] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_concat(node, **kwargs):\n name, input_nodes, attrs = get_inputs(node, kwargs)\n\n axis = int(attrs.get(\"dim\", 1))\n concat_node = onnx.helper.make_node(\n \"Concat\",\n input_nodes,\n [name],\n axis=axis,\n name=name\n )\n return [concat_node]",
"de... | [
"0.7233822",
"0.70961404",
"0.6707305",
"0.6454889",
"0.64343643",
"0.6412976",
"0.6336564",
"0.63213706",
"0.60288745",
"0.60278517",
"0.59759504",
"0.58231926",
"0.57735884",
"0.57064074",
"0.5681187",
"0.565455",
"0.5654235",
"0.5651357",
"0.5630985",
"0.5547733",
"0.55437... | 0.7367524 | 0 |
create extra 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],
outputs=[output_name],
name=output_name,
)
return [expand_node] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mutate_expand_node(\n child, node=None, pb_en_out_link=config.MUTPB_EN_OUT_LINK):\n # TODO: can maybe be improved by sparqling\n if not node:\n nodes = list(child.nodes)\n node = random.choice(nodes)\n new_triple, _, _ = _mutate_expand_node_helper(node, pb_en_out_link)\n return... | [
"0.6341064",
"0.6288607",
"0.62806153",
"0.6086077",
"0.5995333",
"0.5976243",
"0.59042525",
"0.58790493",
"0.58487433",
"0.5824369",
"0.5777672",
"0.57740724",
"0.5769714",
"0.5760391",
"0.5726708",
"0.5703688",
"0.56856406",
"0.5679697",
"0.5621045",
"0.5600409",
"0.5491694... | 0.7317582 | 0 |
create extra shape node for specified input node | def create_helper_shape_node(input_name, output_name):
shape_node = onnx.helper.make_node(
"Shape",
inputs=[input_name],
outputs=[output_name],
name=output_name,
)
return [shape_node] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_shape(node, **kwargs):\n return create_basic_op_node('Shape', node, kwargs)",
"def add_input_and_output_shape(self, input_shape, output_shape):",
"def ashape(node):\n shp = node.shape\n assert shp is not None\n return shp",
"def _create_reshape(cls, op, op_t):\n # make the shap... | [
"0.6897857",
"0.6676977",
"0.65623456",
"0.6395802",
"0.6266121",
"0.6219381",
"0.6160772",
"0.6141284",
"0.6076785",
"0.60708976",
"0.60563433",
"0.6043666",
"0.6030497",
"0.59740275",
"0.59445137",
"0.5934724",
"0.5927032",
"0.5918327",
"0.59053826",
"0.58898586",
"0.585948... | 0.7563421 | 0 |
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):
name, input_nodes, attrs = get_inputs(node, kwargs)
input_node_a = input_nodes[0]
input_node_b = input_nodes[1]
trans_a_node = None
trans_b_node = None
trans_a = get_boolean_attribute_value(attrs, "transpose_a")
trans_b = get_boolean_attribute_value(attrs, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transpose_dot(self, other):\n from divisi2 import operators\n return operators.transpose_dot(self, other)",
"def _convert_operator(op_name, attrs, identity_list=None, convert_map=None):\n identity_list = identity_list if identity_list else _identity_list\n convert_map = convert_map if con... | [
"0.5712867",
"0.56176335",
"0.554931",
"0.5514312",
"0.5504516",
"0.54418373",
"0.5436186",
"0.54350364",
"0.54332083",
"0.5432765",
"0.5416694",
"0.53294843",
"0.53082806",
"0.5298505",
"0.52948254",
"0.5290505",
"0.52547127",
"0.52381",
"0.5236047",
"0.5189316",
"0.5149108"... | 0.6954135 | 0 |
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):
name, input_nodes, attrs = get_inputs(node, kwargs)
# Getting the attributes and assigning default values.
alpha = float(attrs.get("alpha", 1.0))
trans_a = get_boolean_attribute_value(attrs, "transpose_a")
trans_b = get_boolean_attribute_value(attrs, "trans... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_gemm(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n\n node.attribute.extend([\n helper.make_attribute('alpha', float(op.alpha)),\n helper.make_attribute('beta', float(op.beta)),\n helper.make_attribute('transA', op.transA),\n ... | [
"0.6389869",
"0.62474555",
"0.59834313",
"0.5800283",
"0.57034826",
"0.56631166",
"0.5639739",
"0.542331",
"0.5402771",
"0.53584194",
"0.53427106",
"0.53198403",
"0.5156288",
"0.51285404",
"0.50952226",
"0.5079322",
"0.50783587",
"0.5072455",
"0.5072435",
"0.5067956",
"0.5063... | 0.7864781 | 0 |
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):
name, input_nodes, attrs = get_inputs(node, kwargs)
kernel = eval(attrs["kernel"])
pool_type = attrs["pool_type"] if attrs.get("pool_type") else "max"
stride = eval(attrs["stride"]) if attrs.get("stride") else (1, 1)
global_pool = get_boolean_attribute_value(att... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_roipooling(node, **kwargs):\n name, input_nodes, attrs = get_inputs(node, kwargs)\n\n pooled_shape = convert_string_to_list(attrs.get('pooled_size'))\n scale = float(attrs.get(\"spatial_scale\"))\n\n node = onnx.helper.make_node(\n 'MaxRoiPool',\n input_nodes,\n [name],... | [
"0.6422184",
"0.6282772",
"0.61572933",
"0.6030548",
"0.59187293",
"0.5839444",
"0.5670332",
"0.55067396",
"0.546821",
"0.53994155",
"0.5370744",
"0.5343035",
"0.52772164",
"0.5261299",
"0.5253784",
"0.52436227",
"0.5200312",
"0.51936644",
"0.51801187",
"0.51740825",
"0.51138... | 0.7350024 | 0 |
Map MXNet's exp operator attributes to onnx's Exp operator and return the created node. | def convert_exp(node, **kwargs):
return create_basic_op_node('Exp', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exp(self):\n return type(self)(self.parent(), self._simplify(self._express.exp()))",
"def exp(self: Float[LinearOperator, \"*batch M N\"]) -> Float[LinearOperator, \"*batch M N\"]:\n return self.__class__(self._diag.exp())",
"def expr(self):\n return self._express",
"def expon(*args,... | [
"0.63551813",
"0.6045158",
"0.5848142",
"0.58281314",
"0.5785661",
"0.5784021",
"0.5707887",
"0.56942314",
"0.5616022",
"0.5590413",
"0.5572627",
"0.5540329",
"0.5512824",
"0.5411621",
"0.53919",
"0.5374348",
"0.535856",
"0.5315022",
"0.5296157",
"0.5277749",
"0.52776116",
... | 0.7500115 | 0 |
Map MXNet's _copy operator attributes to onnx's Identity operator and return the created node. | def convert_copy(node, **kwargs):
return create_basic_op_node('Identity', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clone(self):\r\n cp = self.__class__(self.op, self.inputs, [output.clone() for output in self.outputs])\r\n cp.tag = copy(self.tag)\r\n return cp",
"def copy_as_new(self) -> \"Individual\":\n return Individual(self.main_node.copy(), to_pipeline=self._to_pipeline)",
"def __call__... | [
"0.6040742",
"0.59664553",
"0.59002656",
"0.58588904",
"0.5807119",
"0.5798085",
"0.572463",
"0.57207906",
"0.56919736",
"0.56849563",
"0.567741",
"0.5644937",
"0.55868983",
"0.55787975",
"0.5568176",
"0.55487376",
"0.5499865",
"0.5467768",
"0.5450066",
"0.5446349",
"0.543404... | 0.7632108 | 0 |
Map MXNet's identity operator attributes to onnx's ConstantFill operator and return the created node. | def convert_identity(node, **kwargs):
return create_basic_op_node('ConstantFill', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_copy(node, **kwargs):\n return create_basic_op_node('Identity', node, kwargs)",
"def _create_constantOfShape(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n tensor_type = onnx.TensorProto.FLOAT if isinstance(\n op.value, float) else onnx.TensorPr... | [
"0.5793247",
"0.55757725",
"0.53495646",
"0.5342002",
"0.5303849",
"0.5282525",
"0.52815294",
"0.5273177",
"0.5256617",
"0.5214077",
"0.5213285",
"0.5184088",
"0.51712525",
"0.51261264",
"0.511096",
"0.50941354",
"0.5083022",
"0.50758964",
"0.5066469",
"0.50372505",
"0.502145... | 0.76081395 | 0 |
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):
name, input_nodes, attrs = get_inputs(node, kwargs)
eps = float(attrs.get("eps", 0.001))
node = onnx.helper.make_node(
'InstanceNormalization',
inputs=input_nodes,
outputs=[name],
name=name,
epsilon=eps)
return [node] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_instance_norm(g, op, block):\n\n x = g.get_node(op.input(\"X\")[0])\n gamma = g.get_node(op.input(\"Scale\")[0])\n beta = g.get_node(op.input(\"Bias\")[0])\n epsilon = op.attr(\"epsilon\")\n\n scale = center = True\n out = _op.nn.instance_norm(x, gamma, beta, axis=1, epsilon=epsilon, ... | [
"0.68201405",
"0.6210069",
"0.6158336",
"0.5857216",
"0.5686284",
"0.56264687",
"0.55710334",
"0.55510676",
"0.54553306",
"0.5442757",
"0.54066503",
"0.53916603",
"0.53645897",
"0.536249",
"0.5269938",
"0.5257382",
"0.52224195",
"0.51939166",
"0.5191482",
"0.51271725",
"0.507... | 0.74606353 | 0 |
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):
name, input_nodes, attrs = get_inputs(node, kwargs)
initializer = kwargs["initializer"]
act_type = attrs.get("act_type", "leaky")
alpha = float(attrs.get("slope", 0.25))
act_name = {"elu": "Elu", "leaky": "LeakyRelu", "prelu": "PRelu",
"selu":... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_leakyrelu(cls, onnx_node, inputs, opset_version):\n alpha = onnx_node.getattr(\"alpha\", 0.01)\n _, forward = cls._common_onnx_node_to_singa_op(onnx_node, inputs,\n opset_version)\n return _, forward(alpha)",
"def convert_relu... | [
"0.6645275",
"0.64907336",
"0.64269954",
"0.6418857",
"0.6116449",
"0.59967774",
"0.5878855",
"0.5858891",
"0.5726611",
"0.567721",
"0.5667963",
"0.56440437",
"0.55542094",
"0.5381494",
"0.5375752",
"0.5368928",
"0.535867",
"0.5342397",
"0.5317905",
"0.5286128",
"0.5262697",
... | 0.67764103 | 0 |
Map MXNet's RNN operator attributes to onnx's RNN operator and return the created node. | def convert_RNN(node, **kwargs):
name, input_nodes, attrs = get_inputs(node, kwargs)
nodes = []
# ============================== Attributes ==============================
mode = attrs['mode'].upper()
rnn_kwargs = {}
if mode != 'LSTM':
raise NotImplementedError(
"Only LSTM mo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_cast(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n\n map_dict = {\n tensor.float32: TensorProto.FLOAT, # FLOAT to float32\n tensor.int32: TensorProto.INT32, # INT32 to int32\n }\n node.attribute.extend([\n helpe... | [
"0.573704",
"0.5696308",
"0.5613529",
"0.56037074",
"0.55654407",
"0.5430018",
"0.54215723",
"0.5411738",
"0.540513",
"0.5397167",
"0.5390512",
"0.5343584",
"0.53244823",
"0.53124344",
"0.5312318",
"0.5296085",
"0.5295705",
"0.52775544",
"0.5250277",
"0.52421296",
"0.52008814... | 0.6088374 | 0 |
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):
name, input_nodes, attrs = get_inputs(node, kwargs)
axis = int(attrs.get("dim"))
# mxnet RNN node and ONNX RNN/LSTM/GRU nodes
# use different ways to store their parameters
# The conversion between these formats is broken into 2 steps
# The first s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_concat(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n\n node.attribute.extend([\n helper.make_attribute('axis', op.axis),\n ])\n return node",
"def convert_concat(node, **kwargs):\n name, input_nodes, attrs = get_inputs(node, kwarg... | [
"0.73427945",
"0.7049503",
"0.67380154",
"0.6468759",
"0.6443857",
"0.60110635",
"0.56656677",
"0.5663238",
"0.5535425",
"0.5531253",
"0.54857755",
"0.5458668",
"0.537242",
"0.531605",
"0.5313958",
"0.5275782",
"0.5205251",
"0.5205095",
"0.51890177",
"0.5185862",
"0.5184087",... | 0.7519251 | 0 |
Map MXNet's transpose operator attributes to onnx's Transpose operator and return the created node. | def convert_transpose(node, **kwargs):
name, input_nodes, attrs = get_inputs(node, kwargs)
axes = attrs.get("axes", ())
if axes:
axes = tuple(map(int, re.findall(r'\d+', axes)))
transpose_node = onnx.helper.make_node(
"Transpose",
input_nodes,
[name],
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_transpose(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n\n node.attribute.extend([\n helper.make_attribute('perm', op.perm),\n ])\n return node",
"def _create_transpose(cls, onnx_node, inputs, opset_version):\n shape = inputs[0... | [
"0.78956044",
"0.7164064",
"0.69711393",
"0.69439864",
"0.6919916",
"0.6686743",
"0.6489473",
"0.63730687",
"0.6343207",
"0.61527866",
"0.61493826",
"0.6142635",
"0.6139026",
"0.6132935",
"0.60538316",
"0.60287285",
"0.5990234",
"0.59900707",
"0.59613836",
"0.59398377",
"0.59... | 0.74619085 | 1 |
Map MXNet's LRN operator attributes to onnx's LRN operator and return the created node. | def convert_lrn(node, **kwargs):
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", 1.0))
size = int(attrs.get("nsize"))
lrn_node = onnx.helper.make_node(
"LRN",
inp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calcLnLFromNode(self, nd):\n #---+----|----+----|----+----|----+----|----+----|----+----|----+----|\n return TreeLikelihoodBase.calcLnLFromNode(self, nd)",
"def convert_attributes(cls, attrs):\n if attrs.get_int(\"axis\") != 1:\n raise RuntimeError(\n f\"Unsuppo... | [
"0.5615053",
"0.5551711",
"0.5397873",
"0.5347614",
"0.53341866",
"0.5257164",
"0.5226096",
"0.5202186",
"0.5176221",
"0.5120736",
"0.5096025",
"0.5051921",
"0.50324756",
"0.5027518",
"0.50227654",
"0.49056938",
"0.48989987",
"0.48988622",
"0.4888863",
"0.4885868",
"0.4884632... | 0.6714993 | 0 |
Map MXNet's L2Normalization operator attributes to onnx's LpNormalization operator and return the created node. | def convert_l2normalization(node, **kwargs):
name, input_nodes, attrs = get_inputs(node, kwargs)
mode = attrs.get("mode", "instance")
if mode != "channel":
raise AttributeError("L2Normalization: ONNX currently supports channel mode only")
l2norm_node = onnx.helper.make_node(
"LpNormal... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_norm(g, op, block):\n\n x = g.get_node(op.input(\"X\")[0])\n axis = op.attr(\"axis\")\n axis_l = [axis]\n epsilon = op.attr(\"epsilon\")\n out = _op.nn.l2_normalize(x, epsilon, axis_l)\n g.add_node(op.output(\"Out\")[0], out)",
"def convert_norm(node, **kwargs):\n name, input_nod... | [
"0.59415656",
"0.5882721",
"0.58236057",
"0.5708504",
"0.5625045",
"0.54728884",
"0.54538465",
"0.53243077",
"0.5301751",
"0.52801716",
"0.5251732",
"0.51723593",
"0.5098865",
"0.50875914",
"0.5062995",
"0.5036322",
"0.5006597",
"0.4991197",
"0.49699366",
"0.49565876",
"0.491... | 0.71821564 | 0 |
Map MXNet's Dropout operator attributes to onnx's Dropout operator and return the created node. | def convert_dropout(node, **kwargs):
name, input_nodes, attrs = get_inputs(node, kwargs)
probability = float(attrs.get("p", 0.5))
probability = np.array(probability, dtype=np.float32)
training_mode = False
training_mode = np.array(training_mode, dtype=np.bool)
node_ratio = create_helper_tenso... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_dropout(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n\n node.attribute.extend([\n helper.make_attribute('ratio', op.ratio),\n ])\n return node",
"def _create_dropout(cls, onnx_node, inputs, opset_version):\n ratio = onnx_node.... | [
"0.7353928",
"0.65540075",
"0.6395461",
"0.6285999",
"0.5709964",
"0.55830383",
"0.55629826",
"0.55001",
"0.5478698",
"0.5474093",
"0.546457",
"0.53771776",
"0.53521633",
"0.5260273",
"0.5242218",
"0.51851434",
"0.5174336",
"0.5164886",
"0.5147427",
"0.51048636",
"0.5103446",... | 0.7049092 | 1 |
Map MXNet's Flatten operator attributes to onnx's Flatten operator and return the created node. | def convert_flatten(node, **kwargs):
return create_basic_op_node('Flatten', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_flatten(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n\n node.attribute.extend([\n helper.make_attribute('axis', op.axis),\n ])\n return node",
"def _create_flatten(cls, onnx_node, inputs, opset_version):\n factor = onnx_node.g... | [
"0.70053905",
"0.6535054",
"0.6155151",
"0.61142373",
"0.6006348",
"0.5795786",
"0.5709457",
"0.56205976",
"0.5437379",
"0.54225713",
"0.5404203",
"0.5383438",
"0.5313076",
"0.5282197",
"0.5249121",
"0.5248736",
"0.522337",
"0.5183563",
"0.51568246",
"0.51036185",
"0.51030135... | 0.68925685 | 1 |
Map MXNet's Clip operator attributes to onnx's Clip operator and return the created node. | def convert_clip(node, **kwargs):
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.helper.make_node(
"Clip",
input_nodes,
[name],
name=name,
min=a_min,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_clip(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n if op.min is not None:\n node.input.append(op.name + \":min\")\n else:\n node.input.append(\"\")\n if op.max is not None:\n node.input.append(op.name + \":max\")\... | [
"0.64989394",
"0.5577588",
"0.5251773",
"0.5233911",
"0.50637215",
"0.50445",
"0.5005481",
"0.4997189",
"0.48964328",
"0.4827775",
"0.48206207",
"0.48055732",
"0.47918075",
"0.47716203",
"0.47590274",
"0.47138596",
"0.46755806",
"0.4661917",
"0.4658839",
"0.4649198",
"0.46434... | 0.6301358 | 1 |
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):
return scalar_op_helper(node, 'Mul', **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_elemwise_mul(node, **kwargs):\n return create_basic_op_node('Mul', node, kwargs)",
"def convert_broadcast_mul(node, **kwargs):\n return create_basic_op_node('Mul', node, kwargs)",
"def tree_add_scalar_mul(tree_x, scalar, tree_y):\n return tree_multimap(lambda x, y: x + scalar * y, tree_x, tr... | [
"0.79224896",
"0.7241136",
"0.6973371",
"0.6796328",
"0.6784119",
"0.6776615",
"0.67680424",
"0.6747651",
"0.67148656",
"0.6702787",
"0.66282004",
"0.6625424",
"0.6572571",
"0.65414375",
"0.652442",
"0.6481082",
"0.63871235",
"0.63544697",
"0.63508964",
"0.6326876",
"0.632687... | 0.8387702 | 0 |
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):
return scalar_op_helper(node, 'Sub', **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_rminus_scalar(node, **kwargs):\n return scalar_op_helper(node, 'Sub', **kwargs)",
"def convert_minimum(node, **kwargs):\n return create_basic_op_node('Min', node, kwargs)",
"def _create_clip(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n if op.min is ... | [
"0.6305766",
"0.6050129",
"0.60270244",
"0.6017436",
"0.597134",
"0.58471966",
"0.56328523",
"0.5549238",
"0.553047",
"0.5523445",
"0.55042356",
"0.54917306",
"0.5459456",
"0.5451665",
"0.5436429",
"0.5424267",
"0.53898084",
"0.5378877",
"0.53705645",
"0.5368082",
"0.53500354... | 0.6904257 | 0 |
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):
return scalar_op_helper(node, 'Sub', **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_minus_scalar(node, **kwargs):\n return scalar_op_helper(node, 'Sub', **kwargs)",
"def convert_elementwise_sub(node, **kwargs):\n return create_basic_op_node('Sub', node, kwargs)",
"def __sub__(self, other):\r\n if isinstance(other, Node):\r\n new_node = sub_op(self, other)\r... | [
"0.79085666",
"0.68994915",
"0.6750096",
"0.65244937",
"0.61306584",
"0.61295164",
"0.61034423",
"0.6103109",
"0.6042899",
"0.6030476",
"0.6012048",
"0.60119057",
"0.5996009",
"0.5993797",
"0.5971871",
"0.59533864",
"0.5938247",
"0.588912",
"0.58856267",
"0.57691115",
"0.5764... | 0.8166036 | 0 |
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):
return scalar_op_helper(node, 'Add', **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_elementwise_add(node, **kwargs):\n return create_basic_op_node('Add', node, kwargs)",
"def convert_addn(node, **kwargs):\n return create_basic_op_node('Sum', node, kwargs)",
"def covert_broadcast_add(node, **kwargs):\n return create_basic_op_node('Add', node, kwargs)",
"def __add__(self,... | [
"0.767562",
"0.72351784",
"0.69635",
"0.6916363",
"0.69029146",
"0.6712746",
"0.65971774",
"0.6551346",
"0.6480433",
"0.6455669",
"0.64297163",
"0.64250094",
"0.64143014",
"0.63674563",
"0.6350933",
"0.63499177",
"0.63171613",
"0.6313307",
"0.62899745",
"0.6258752",
"0.625835... | 0.80610985 | 0 |
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):
return scalar_op_helper(node, 'Div', **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_elemwise_div(node, **kwargs):\n return create_basic_op_node('Div', node, kwargs)",
"def convert_rdiv_scalar(node, **kwargs):\n return scalar_op_helper(node, 'Div', **kwargs)",
"def convert_broadcast_div(node, **kwargs):\n return create_basic_op_node('Div', node, kwargs)",
"def __div__(se... | [
"0.7483501",
"0.69537693",
"0.6816418",
"0.6603985",
"0.6457433",
"0.63764226",
"0.635181",
"0.6023572",
"0.5944247",
"0.59403896",
"0.5891626",
"0.5882687",
"0.5876528",
"0.58643323",
"0.5856814",
"0.5833514",
"0.5809807",
"0.5758597",
"0.55864036",
"0.5551182",
"0.5471876",... | 0.8018971 | 0 |
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):
return scalar_op_helper(node, 'Div', **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_div_scalar(node, **kwargs):\n return scalar_op_helper(node, 'Div', **kwargs)",
"def convert_elemwise_div(node, **kwargs):\n return create_basic_op_node('Div', node, kwargs)",
"def __rdiv__(self, _scalar):\n\t\treturn self / _scalar",
"def convert_broadcast_div(node, **kwargs):\n return c... | [
"0.7794921",
"0.73854715",
"0.6798597",
"0.67867917",
"0.6434399",
"0.63413435",
"0.6173485",
"0.6116096",
"0.6076342",
"0.5998175",
"0.5978865",
"0.592204",
"0.59028167",
"0.5873986",
"0.587386",
"0.57993555",
"0.575969",
"0.5733526",
"0.5695951",
"0.56446165",
"0.5617565",
... | 0.82317907 | 0 |
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):
return scalar_op_helper(node, 'Pow', **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_power(node, **kwargs):\n return create_basic_op_node('Pow', node, kwargs)",
"def convert_pow(g, op, block):\n\n x = g.get_node(op.input(\"X\")[0])\n dtype = block.var(op.output(\"Out\")[0]).dtype\n dtype = _convert_dtype_value(dtype)\n factor = op.attr(\"factor\")\n factor = _expr.c... | [
"0.73938245",
"0.71553993",
"0.69053197",
"0.6618425",
"0.6509602",
"0.64128435",
"0.6384842",
"0.6307531",
"0.62721306",
"0.6149648",
"0.6126736",
"0.60709953",
"0.60470843",
"0.5954794",
"0.59512776",
"0.59302795",
"0.5929934",
"0.58751506",
"0.58481187",
"0.58359647",
"0.5... | 0.821569 | 0 |
Map MXNet's argmax operator attributes to onnx's ArgMax operator and return the created node. | def convert_argmax(node, **kwargs):
name, input_nodes, attrs = get_inputs(node, kwargs)
axis = int(attrs.get("axis"))
keepdims = get_boolean_attribute_value(attrs, "keepdims")
node = onnx.helper.make_node(
'ArgMax',
inputs=input_nodes,
axis=axis,
keepdims=keepdims,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_maximum(node, **kwargs):\n return create_basic_op_node('Max', node, kwargs)",
"def convert_max(node, **kwargs):\n name, input_nodes, attrs = get_inputs(node, kwargs)\n\n mx_axis = attrs.get(\"axis\", None)\n axes = convert_string_to_list(str(mx_axis)) if mx_axis is not None else None\n\n ... | [
"0.70940566",
"0.6874972",
"0.61902833",
"0.61549073",
"0.61046344",
"0.60914123",
"0.6080087",
"0.5927143",
"0.5927143",
"0.5880221",
"0.58306336",
"0.57700604",
"0.57442945",
"0.57169616",
"0.56744826",
"0.5666791",
"0.56665546",
"0.5664926",
"0.5634875",
"0.5621766",
"0.55... | 0.7944788 | 0 |
Map MXNet's argmin operator attributes to onnx's ArgMin operator and return the created node. | def convert_argmin(node, **kwargs):
name, input_nodes, attrs = get_inputs(node, kwargs)
axis = int(attrs.get("axis"))
keepdims = get_boolean_attribute_value(attrs, "keepdims")
node = onnx.helper.make_node(
'ArgMin',
inputs=input_nodes,
axis=axis,
keepdims=keepdims,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_minimum(node, **kwargs):\n return create_basic_op_node('Min', node, kwargs)",
"def convert_min(node, **kwargs):\n name, input_nodes, attrs = get_inputs(node, kwargs)\n\n mx_axis = attrs.get(\"axis\", None)\n axes = convert_string_to_list(str(mx_axis)) if mx_axis is not None else None\n\n ... | [
"0.7161309",
"0.7048762",
"0.653032",
"0.6511046",
"0.61759573",
"0.6156072",
"0.61389035",
"0.60431165",
"0.60163444",
"0.5919297",
"0.58403546",
"0.5791767",
"0.57676524",
"0.5744902",
"0.5734494",
"0.57265365",
"0.5693712",
"0.56826967",
"0.5673407",
"0.5659327",
"0.565932... | 0.7900277 | 0 |
Map MXNet's _maximum operator attributes to onnx's Max operator and return the created node. | def convert_maximum(node, **kwargs):
return create_basic_op_node('Max', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_max(node, **kwargs):\n name, input_nodes, attrs = get_inputs(node, kwargs)\n\n mx_axis = attrs.get(\"axis\", None)\n axes = convert_string_to_list(str(mx_axis)) if mx_axis is not None else None\n\n keepdims = get_boolean_attribute_value(attrs, \"keepdims\")\n\n if axes is not None:\n ... | [
"0.70796645",
"0.6651025",
"0.64678437",
"0.6413021",
"0.6399445",
"0.63507855",
"0.63063204",
"0.6268924",
"0.624761",
"0.62005275",
"0.6182359",
"0.6182359",
"0.6120072",
"0.6118509",
"0.61165994",
"0.6114771",
"0.60751885",
"0.6062354",
"0.60444164",
"0.60346764",
"0.60116... | 0.79425055 | 0 |
Map MXNet's _minimum operator attributes to onnx's Min operator and return the created node. | def convert_minimum(node, **kwargs):
return create_basic_op_node('Min', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_min(node, **kwargs):\n name, input_nodes, attrs = get_inputs(node, kwargs)\n\n mx_axis = attrs.get(\"axis\", None)\n axes = convert_string_to_list(str(mx_axis)) if mx_axis is not None else None\n\n keepdims = get_boolean_attribute_value(attrs, \"keepdims\")\n\n if axes is not None:\n ... | [
"0.7165784",
"0.66267216",
"0.65062666",
"0.6468117",
"0.6441443",
"0.643317",
"0.63803333",
"0.6362957",
"0.6308952",
"0.628914",
"0.628914",
"0.6285821",
"0.62643987",
"0.6242156",
"0.62365615",
"0.6184856",
"0.618154",
"0.61484843",
"0.6128366",
"0.61151135",
"0.61137015",... | 0.79770553 | 0 |
Map MXNet's min operator attributes to onnx's ReduceMin operator and return the created node. | def convert_min(node, **kwargs):
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 None
keepdims = get_boolean_attribute_value(attrs, "keepdims")
if axes is not None:
node = onnx.he... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_minimum(node, **kwargs):\n return create_basic_op_node('Min', node, kwargs)",
"def min(x, reduce_instance_dims=True, name=None): # pylint: disable=redefined-builtin\n return _numeric_combine(x, np.min, reduce_instance_dims, name)",
"def produce_min(self, meta, raven_vars, dispatch, t):\n if... | [
"0.74088675",
"0.6358284",
"0.61328006",
"0.61307657",
"0.5984475",
"0.5984475",
"0.59366184",
"0.59366184",
"0.59366184",
"0.586159",
"0.58153784",
"0.58141047",
"0.5771208",
"0.5747477",
"0.5725165",
"0.57177365",
"0.56871665",
"0.5682544",
"0.5676312",
"0.5637121",
"0.5634... | 0.76065016 | 0 |
Map MXNet's max operator attributes to onnx's ReduceMax operator and return the created node. | def convert_max(node, **kwargs):
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 None
keepdims = get_boolean_attribute_value(attrs, "keepdims")
if axes is not None:
node = onnx.he... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_maximum(node, **kwargs):\n return create_basic_op_node('Max', node, kwargs)",
"def max(x, reduce_instance_dims=True, name=None): # pylint: disable=redefined-builtin\n return _numeric_combine(x, np.max, reduce_instance_dims, name)",
"def convert_argmax(node, **kwargs):\n name, input_nodes, a... | [
"0.7659286",
"0.6377665",
"0.6145082",
"0.6139816",
"0.6064376",
"0.6055874",
"0.6041896",
"0.6037136",
"0.5989364",
"0.5909807",
"0.5900593",
"0.5855207",
"0.58143365",
"0.5796772",
"0.57937384",
"0.57896626",
"0.5788211",
"0.578123",
"0.5748129",
"0.57333666",
"0.57123965",... | 0.7726849 | 0 |
Map MXNet's mean operator attributes to onnx's ReduceMean operator and return the created node. | def convert_mean(node, **kwargs):
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 None
keepdims = get_boolean_attribute_value(attrs, "keepdims")
if axes is not None:
node = onnx.h... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_reduce_mean_02():\n\n class ReduceMeanTester(Base):\n def create_onnx(self) -> onnx.ModelProto:\n node = make_node(\"ReduceMean\", inputs=[\"v0\"], outputs=[\"v1\"], axes=[1, 2])\n inputs = [info(\"v0\", TensorProto.FLOAT, (1, 3, 4, 5))]\n outputs = [info(\"v1\",... | [
"0.6283045",
"0.6170426",
"0.61373425",
"0.58561695",
"0.5818263",
"0.5725782",
"0.5599807",
"0.5562414",
"0.5543096",
"0.5514586",
"0.5514586",
"0.5514586",
"0.5514586",
"0.5514586",
"0.54903483",
"0.5438709",
"0.5438554",
"0.53819174",
"0.53819174",
"0.5381861",
"0.5380131"... | 0.7579308 | 0 |
Map MXNet's prod operator attributes to onnx's ReduceProd operator and return the created node. | def convert_prod(node, **kwargs):
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 None
keepdims = get_boolean_attribute_value(attrs, "keepdims")
if axes is not None:
node = onnx.h... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_reduceOp(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n\n node.attribute.extend([\n helper.make_attribute('axes', list(op.axes)),\n helper.make_attribute('keepdims', op.keepdims),\n ])\n return node",
"def _create_reduceOp(... | [
"0.62867284",
"0.5835511",
"0.57357043",
"0.5722716",
"0.5617108",
"0.5607751",
"0.55567515",
"0.5480656",
"0.54691935",
"0.543317",
"0.54207885",
"0.5408181",
"0.53855884",
"0.52865595",
"0.5275297",
"0.5250045",
"0.5214458",
"0.52013505",
"0.5191116",
"0.51694757",
"0.51609... | 0.75327003 | 0 |
Map MXNet's elemwise_add operator attributes to onnx's Add operator and return the created node. | def convert_elementwise_add(node, **kwargs):
return create_basic_op_node('Add', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def covert_broadcast_add(node, **kwargs):\n return create_basic_op_node('Add', node, kwargs)",
"def __add__(self, other):\r\n if isinstance(other, Node):\r\n new_node = add_op(self, other)\r\n else:\r\n # Add by a constant stores the constant in the new node's const_attr fi... | [
"0.7189428",
"0.655496",
"0.6537227",
"0.6472508",
"0.6449052",
"0.64310604",
"0.6380455",
"0.62438035",
"0.6235679",
"0.6205862",
"0.6189562",
"0.6052324",
"0.6052324",
"0.60426134",
"0.60199106",
"0.60036284",
"0.5988608",
"0.59885174",
"0.5946734",
"0.5942936",
"0.5912339"... | 0.79225135 | 0 |
Map MXNet's broadcast_add operator attributes to onnx's Add operator and return the created node. | def covert_broadcast_add(node, **kwargs):
return create_basic_op_node('Add', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_elementwise_add(node, **kwargs):\n return create_basic_op_node('Add', node, kwargs)",
"def _add_node(self, node_entry, idx):\n if node_entry[\"op\"].name not in relay_to_onnx_op_mapping:\n raise NotImplementedError(\n f\"Currently the operator '{node_entry['op'].na... | [
"0.6780478",
"0.63417214",
"0.60001606",
"0.58787817",
"0.5827999",
"0.5784491",
"0.5780997",
"0.5736768",
"0.56432146",
"0.5639515",
"0.5625344",
"0.56026065",
"0.5514841",
"0.5495319",
"0.5493361",
"0.54555446",
"0.54506385",
"0.544259",
"0.543173",
"0.5420061",
"0.541649",... | 0.8338817 | 0 |
Map MXNet's elemwise_sub operator attributes to onnx's Sub operator and return the created node. | def convert_elementwise_sub(node, **kwargs):
return create_basic_op_node('Sub', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def covert_broadcast_sub(node, **kwargs):\n return create_basic_op_node('Sub', node, kwargs)",
"def __sub__(self, other):\r\n if isinstance(other, Node):\r\n new_node = sub_op(self, other)\r\n else:\r\n # Add by a constant stores the constant in the new node's const_attr fi... | [
"0.7141842",
"0.68545747",
"0.615163",
"0.6033808",
"0.5878628",
"0.58357406",
"0.5734108",
"0.5729102",
"0.56466043",
"0.56212085",
"0.55548865",
"0.5548119",
"0.54640967",
"0.5426134",
"0.5379119",
"0.5364434",
"0.53603375",
"0.53511447",
"0.5314139",
"0.53106934",
"0.52824... | 0.78317475 | 0 |
Map MXNet's broadcast_sub operator attributes to onnx's Sub operator and return the created node. | def covert_broadcast_sub(node, **kwargs):
return create_basic_op_node('Sub', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_elementwise_sub(node, **kwargs):\n return create_basic_op_node('Sub', node, kwargs)",
"def __sub__(self, other):\r\n if isinstance(other, Node):\r\n new_node = sub_op(self, other)\r\n else:\r\n # Add by a constant stores the constant in the new node's const_attr... | [
"0.67469776",
"0.58889604",
"0.5360961",
"0.52912056",
"0.52282476",
"0.5209201",
"0.51015747",
"0.5097751",
"0.5091051",
"0.5062901",
"0.5049066",
"0.5000981",
"0.4991342",
"0.49907017",
"0.49763283",
"0.49502683",
"0.4915788",
"0.4915497",
"0.49108106",
"0.48997536",
"0.486... | 0.789098 | 0 |
Map MXNet's elemwise_mul operator attributes to onnx's Mul operator and return the created node. | def convert_elemwise_mul(node, **kwargs):
return create_basic_op_node('Mul', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_broadcast_mul(node, **kwargs):\n return create_basic_op_node('Mul', node, kwargs)",
"def convert_mul_scalar(node, **kwargs):\n return scalar_op_helper(node, 'Mul', **kwargs)",
"def __mul__(self, other):\n\n return self._binary_elementwise_op(other, np.multiply)",
"def __mul__(self,th... | [
"0.7594407",
"0.71869403",
"0.6733486",
"0.66129386",
"0.6552191",
"0.6502875",
"0.6452503",
"0.6406036",
"0.6391522",
"0.6358358",
"0.6305449",
"0.62934154",
"0.62835354",
"0.62716043",
"0.62310976",
"0.6220493",
"0.6211813",
"0.62024266",
"0.6190721",
"0.6168245",
"0.616184... | 0.8666627 | 0 |
Map MXNet's broadcast_mul operator attributes to onnx's Mul operator and return the created node. | def convert_broadcast_mul(node, **kwargs):
return create_basic_op_node('Mul', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_elemwise_mul(node, **kwargs):\n return create_basic_op_node('Mul', node, kwargs)",
"def convert_mul_scalar(node, **kwargs):\n return scalar_op_helper(node, 'Mul', **kwargs)",
"def convert_broadcast_power(node, **kwargs):\n return create_basic_op_node('Pow', node, kwargs)",
"def __mul__(s... | [
"0.7861241",
"0.6676384",
"0.6386201",
"0.63332176",
"0.62079525",
"0.6138245",
"0.6137143",
"0.61355305",
"0.6135341",
"0.6122188",
"0.6114543",
"0.60985154",
"0.60596746",
"0.5996618",
"0.5970572",
"0.5940501",
"0.5925935",
"0.5879273",
"0.5866603",
"0.58360845",
"0.5831286... | 0.8551312 | 0 |
Map MXNet's elemwise_div operator attributes to onnx's Div operator and return the created node. | def convert_elemwise_div(node, **kwargs):
return create_basic_op_node('Div', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_broadcast_div(node, **kwargs):\n return create_basic_op_node('Div', node, kwargs)",
"def convert_div_scalar(node, **kwargs):\n return scalar_op_helper(node, 'Div', **kwargs)",
"def __div__(self,that):\n return self.__opExpand2(that, np.divide)",
"def __div__(self, other, **kwargs):\n ... | [
"0.7340376",
"0.6443447",
"0.61537325",
"0.592873",
"0.5718753",
"0.5646812",
"0.5636024",
"0.5619774",
"0.5601933",
"0.5586622",
"0.5423298",
"0.54130757",
"0.5413029",
"0.5365055",
"0.52879655",
"0.52837497",
"0.52705294",
"0.5257432",
"0.5253376",
"0.5204898",
"0.5200385",... | 0.8170008 | 0 |
Map MXNet's broadcast_div operator attributes to onnx's Div operator and return the created node. | def convert_broadcast_div(node, **kwargs):
return create_basic_op_node('Div', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_elemwise_div(node, **kwargs):\n return create_basic_op_node('Div', node, kwargs)",
"def convert_div_scalar(node, **kwargs):\n return scalar_op_helper(node, 'Div', **kwargs)",
"def __div__(self,that):\n return self.__opExpand2(that, np.divide)",
"def divmod_node(self, mpi_procs, omp_threa... | [
"0.7091991",
"0.5654483",
"0.54506725",
"0.5246034",
"0.5235014",
"0.5234837",
"0.5166161",
"0.5122407",
"0.51005995",
"0.5100523",
"0.5087641",
"0.50812745",
"0.5039023",
"0.50275385",
"0.49929944",
"0.49497214",
"0.49223348",
"0.49145442",
"0.48808396",
"0.4876805",
"0.4875... | 0.81881297 | 0 |
Map MXNet's negative operator attributes to onnx's Neg operator and return the created node. | def convert_negative(node, **kwargs):
return create_basic_op_node('Neg', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __neg__(self):\n return UnaryMinus(self)",
"def __neg__(self) -> ColumnOperators:\n return self.operate(neg)",
"def __neg__(self):\n return type(self)(self.parent(), self._simplify(-self._express))",
"def __neg__(self):\n data = [[-self[i, j] for j in range(self.n)] for i in r... | [
"0.71537274",
"0.69829476",
"0.69523317",
"0.6824377",
"0.67790425",
"0.6737146",
"0.67330045",
"0.67264277",
"0.6704793",
"0.66476816",
"0.65888995",
"0.6529035",
"0.6525028",
"0.6494333",
"0.64887315",
"0.6466599",
"0.6442492",
"0.6382106",
"0.6371845",
"0.6371845",
"0.6351... | 0.7796946 | 0 |
Map MXNet's abs operator attributes to onnx's Abs operator and return the created node. | def convert_abs(node, **kwargs):
return create_basic_op_node('Abs', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def abs(self) -> LinearOperator:\n return self.__class__(self._diag.abs())",
"def __abs__(self):\n out = self.copy()\n out.addFunction(Query.Function.Abs)\n return out",
"def abs(self):\n\n return self._get(\"abs\", rtype=self.__class__)",
"def __init__(self):\n Gina... | [
"0.6505",
"0.6213608",
"0.6065252",
"0.592394",
"0.58516395",
"0.5665779",
"0.5517811",
"0.5490736",
"0.5476933",
"0.54744714",
"0.54476523",
"0.54003453",
"0.5390359",
"0.5326909",
"0.5319726",
"0.5315074",
"0.53031343",
"0.52716726",
"0.5261375",
"0.5250854",
"0.524636",
... | 0.7698864 | 0 |
Map MXNet's add_n operator attributes to onnx's Sum operator and return the created node. | def convert_addn(node, **kwargs):
return create_basic_op_node('Sum', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_elementwise_add(node, **kwargs):\n return create_basic_op_node('Add', node, kwargs)",
"def covert_broadcast_add(node, **kwargs):\n return create_basic_op_node('Add', node, kwargs)",
"def ADD (self, n1, n2):",
"def convert_sum(node, **kwargs):\n name, input_nodes, attrs = get_inputs(node,... | [
"0.66162986",
"0.65958875",
"0.65007085",
"0.6439678",
"0.6250043",
"0.5785631",
"0.5775108",
"0.57710975",
"0.57699406",
"0.57460105",
"0.5735643",
"0.57265383",
"0.5694182",
"0.5615365",
"0.5607123",
"0.56009924",
"0.5595946",
"0.5591358",
"0.5585656",
"0.5575787",
"0.55362... | 0.79465455 | 0 |
Map MXNet's ceil operator attributes to onnx's Ceil operator and return the created node. | def convert_ceil(node, **kwargs):
return create_basic_op_node('Ceil', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n BuiltinFunction.__init__(self, \"ceil\",\n conversions=dict(maxima='ceiling',\n sympy='ceiling'))",
"def __ceil__(self, ???):",
"def ceil(raw_tensor):\n dst_dtype = \"int32\"\n\n return cast_... | [
"0.57651013",
"0.5506392",
"0.5357824",
"0.5333224",
"0.5305275",
"0.52933913",
"0.52933913",
"0.52933913",
"0.52933913",
"0.52933913",
"0.52933913",
"0.52933913",
"0.52933913",
"0.52933913",
"0.52933913",
"0.52933913",
"0.52933913",
"0.52933913",
"0.52933913",
"0.52933913",
... | 0.76702064 | 0 |
Map MXNet's floor operator attributes to onnx's Floor operator and return the created node. | def convert_floor(node, **kwargs):
return create_basic_op_node('Floor', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_floor(tile):\n rtn = bmesh.new()\n rtn.from_object(bpy.data.objects['FLOOR_CENTER'], bpy.context.scene)\n BmeshFactory.add_floor_corners(rtn, tile)\n rtn.from_object(bpy.data.objects[tile.terrain_type().name], bpy.context.scene)\n BmeshFactory.add_ceiling_center_below(r... | [
"0.5913754",
"0.5866849",
"0.5621953",
"0.5610637",
"0.55931014",
"0.5583222",
"0.54438764",
"0.53761",
"0.53067064",
"0.5256313",
"0.5121537",
"0.50940347",
"0.5093765",
"0.5074465",
"0.50180596",
"0.50060546",
"0.49971378",
"0.49704736",
"0.49595678",
"0.49277905",
"0.49110... | 0.76645154 | 0 |
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):
name, input_nodes, attrs = get_inputs(node, kwargs)
output_shape_list = convert_string_to_list(attrs["shape"])
initializer = kwargs["initializer"]
output_shape_np = np.array(output_shape_list, dtype='int64')
data_type = onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[outpu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_helper_reshape_node(input_name, output_name, shape, kwargs):\n shape_tensor_node, = create_helper_tensor_node(\n np.asarray(shape, dtype=np.int64), output_name + \"__shape\", kwargs\n )\n reshape_node = onnx.helper.make_node(\n \"Reshape\",\n inputs=[input_name, shape_tenso... | [
"0.7556744",
"0.7085336",
"0.7027707",
"0.67682624",
"0.67622006",
"0.67400914",
"0.65949494",
"0.65602094",
"0.6389615",
"0.6363775",
"0.62704414",
"0.61320436",
"0.6128499",
"0.6113789",
"0.5977804",
"0.5916986",
"0.58968294",
"0.5860646",
"0.58554107",
"0.5846493",
"0.5837... | 0.77601105 | 0 |
Map MXNet's slice_axis operator attributes to onnx's Slice operator and return the created node. | def convert_slice_axis(node, **kwargs):
name, input_nodes, input_shapes, attrs = get_inputs(node, kwargs, with_shapes=True)
axes = int(attrs.get("axis"))
starts = int(attrs.get("begin"))
ends = attrs.get("end", None)
if not ends or ends == 'None':
# ONNX doesn't support None for ends. Since... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_slice(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n for attr in ['starts', 'ends', 'axes', 'steps']:\n node.input.append(op.name + \":\" + attr)\n return node",
"def _fix_slice(self, inputs, new_attr):\n begin = new_attr.get('begin')... | [
"0.71705914",
"0.68219244",
"0.6615894",
"0.6356295",
"0.6166811",
"0.6157213",
"0.61249214",
"0.5888455",
"0.58519363",
"0.58514374",
"0.57256836",
"0.57235664",
"0.5691767",
"0.5674897",
"0.5673684",
"0.5644206",
"0.56324863",
"0.5606119",
"0.5604062",
"0.56020904",
"0.5581... | 0.7049499 | 1 |
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):
name, input_nodes, input_shapes, attrs = get_inputs(node, kwargs, with_shapes=True)
num_outputs = int(attrs.get("num_outputs"))
axis = int(attrs.get("axis", 1))
squeeze_axis = int(attrs.get("squeeze_axis", 0))
if squeeze_axis == 1 and num_outputs == 1:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_squeeze(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n\n node.attribute.extend([\n helper.make_attribute('axes', list(op.axis)),\n ])\n return node",
"def _create_squeeze(cls, onnx_node, inputs, opset_version):\n axes = onnx_no... | [
"0.6746628",
"0.6559421",
"0.61696434",
"0.61142856",
"0.5958457",
"0.5643979",
"0.5640216",
"0.54976195",
"0.54508215",
"0.54356575",
"0.53339934",
"0.53273505",
"0.51586306",
"0.5094175",
"0.5021248",
"0.50043905",
"0.49964705",
"0.49707195",
"0.4929398",
"0.4861826",
"0.48... | 0.669003 | 1 |
Map MXNet's expand_dims operator attributes to onnx's Unsqueeze operator and return the created node. | def convert_expand_dims(node, **kwargs):
name, input_nodes, attrs = get_inputs(node, kwargs)
axis = int(attrs.get("axis"))
node = onnx.helper.make_node(
"Unsqueeze",
input_nodes,
[name],
axes=[axis],
name=name,
)
return [node] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_squeeze(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n\n node.attribute.extend([\n helper.make_attribute('axes', list(op.axis)),\n ])\n return node",
"def _create_squeeze(cls, onnx_node, inputs, opset_version):\n axes = onnx_no... | [
"0.7386183",
"0.6739398",
"0.6726751",
"0.637353",
"0.62995607",
"0.60692775",
"0.60286963",
"0.60238683",
"0.59741277",
"0.59160703",
"0.5735533",
"0.5717082",
"0.5696729",
"0.5589094",
"0.55591923",
"0.5529139",
"0.55204725",
"0.5500257",
"0.54655224",
"0.54617375",
"0.5455... | 0.716333 | 1 |
Map MXNet's log operator attributes to onnx's Log operator and return the created node. | def convert_log(node, **kwargs):
return create_basic_op_node('Log', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def log(self: Float[LinearOperator, \"*batch M N\"]) -> Float[LinearOperator, \"*batch M N\"]:\n return self.__class__(self._diag.log())",
"def log(self: Float[LinearOperator, \"*batch M N\"]) -> Float[LinearOperator, \"*batch M N\"]:\n return ConstantDiagLinearOperator(self.diag_values.log(), diag... | [
"0.59120095",
"0.5716469",
"0.5401583",
"0.5346299",
"0.532194",
"0.5304277",
"0.5276738",
"0.5258929",
"0.51880515",
"0.51534116",
"0.5130242",
"0.5092342",
"0.5069547",
"0.5066726",
"0.505875",
"0.5041651",
"0.50384235",
"0.495094",
"0.49467453",
"0.49352145",
"0.4929605",
... | 0.7054104 | 0 |
Map MXNet's reciprocal operator attributes to onnx's Reciprocal operator and return the created node. | def convert_reciprocal(node, **kwargs):
return create_basic_op_node('Reciprocal', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __call__(self):\n new_node = Node()\n new_node.op = self\n return new_node",
"def __call__(self):\r\n new_node = Op.__call__(self)\r\n return new_node",
"def __call__(self):\n new_node = Op.__call__(self)\n return new_node",
"def __call__(self):\r\n ... | [
"0.5679397",
"0.56778276",
"0.56740934",
"0.56724566",
"0.56111914",
"0.5536893",
"0.54996645",
"0.5413009",
"0.5394044",
"0.53590983",
"0.5352823",
"0.53090364",
"0.53014636",
"0.5288799",
"0.525179",
"0.52360773",
"0.5220722",
"0.5163405",
"0.5150799",
"0.51470494",
"0.5146... | 0.689847 | 0 |
Map MXNet's _power operator attributes to onnx's Pow operator and return the created node. | def convert_power(node, **kwargs):
return create_basic_op_node('Pow', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_broadcast_power(node, **kwargs):\n return create_basic_op_node('Pow', node, kwargs)",
"def convert_pow(g, op, block):\n\n x = g.get_node(op.input(\"X\")[0])\n dtype = block.var(op.output(\"Out\")[0]).dtype\n dtype = _convert_dtype_value(dtype)\n factor = op.attr(\"factor\")\n factor... | [
"0.75909674",
"0.7083156",
"0.66979545",
"0.64450526",
"0.6441693",
"0.64366263",
"0.6400053",
"0.6366476",
"0.63472486",
"0.62409025",
"0.622891",
"0.6202606",
"0.60667837",
"0.6045029",
"0.6029663",
"0.6026515",
"0.60182786",
"0.59912276",
"0.5968232",
"0.5967135",
"0.59407... | 0.79412013 | 0 |
Map MXNet's _power operator attributes to onnx's Pow operator and return the created node. | def convert_broadcast_power(node, **kwargs):
return create_basic_op_node('Pow', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_power(node, **kwargs):\n return create_basic_op_node('Pow', node, kwargs)",
"def convert_pow(g, op, block):\n\n x = g.get_node(op.input(\"X\")[0])\n dtype = block.var(op.output(\"Out\")[0]).dtype\n dtype = _convert_dtype_value(dtype)\n factor = op.attr(\"factor\")\n factor = _expr.c... | [
"0.7941838",
"0.7083369",
"0.66985244",
"0.64452976",
"0.64437544",
"0.6436942",
"0.64016074",
"0.63671076",
"0.63479775",
"0.6240992",
"0.62295127",
"0.6203682",
"0.6067832",
"0.6046127",
"0.60306716",
"0.60275626",
"0.6018355",
"0.5992741",
"0.5969637",
"0.5969036",
"0.5942... | 0.7592172 | 1 |
Map MXNet's sqrt operator attributes to onnx's Sqrt operator and return the created node. | def convert_sqrt(node, **kwargs):
return create_basic_op_node('Sqrt', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __call__(self, node_A):\r\n new_node = Op.__call__(self)\r\n new_node.inputs = [node_A]\r\n new_node.name = \"Sqrt(%s)\" % (node_A.name)\r\n return new_node",
"def sqrt(self):\n return type(self)(self.parent(),\n self._simplify(self._express.sqrt())... | [
"0.65579957",
"0.6451186",
"0.6441741",
"0.6321632",
"0.61004037",
"0.5692846",
"0.56454605",
"0.561679",
"0.55741465",
"0.5483834",
"0.5446249",
"0.5332103",
"0.527836",
"0.52485776",
"0.5248409",
"0.5226648",
"0.5189378",
"0.5185982",
"0.51702994",
"0.5157216",
"0.513852",
... | 0.7393713 | 0 |
Map MXNet's depth_to_space operator attributes to onnx's DepthToSpace operator and return the created node. | def convert_depthtospace(node, **kwargs):
name, input_nodes, attrs = get_inputs(node, kwargs)
blksize = int(attrs.get("block_size", 0))
node = onnx.helper.make_node(
"DepthToSpace",
input_nodes,
[name],
blocksize=blksize,
name=name,
)
return [node] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_spacetodepth(node, **kwargs):\n name, input_nodes, attrs = get_inputs(node, kwargs)\n\n blksize = int(attrs.get(\"block_size\", 0))\n\n node = onnx.helper.make_node(\n \"SpaceToDepth\",\n input_nodes,\n [name],\n blocksize=blksize,\n name=name,\n )\n re... | [
"0.654902",
"0.5397657",
"0.5092263",
"0.5052654",
"0.49498823",
"0.49392277",
"0.4938975",
"0.48952127",
"0.48248088",
"0.48029906",
"0.47768003",
"0.4760767",
"0.47406405",
"0.46349868",
"0.4629043",
"0.45984888",
"0.45853606",
"0.45547014",
"0.45455354",
"0.4535628",
"0.45... | 0.71486926 | 0 |
Map MXNet's space_to_depth operator attributes to onnx's SpaceToDepth operator and return the created node. | def convert_spacetodepth(node, **kwargs):
name, input_nodes, attrs = get_inputs(node, kwargs)
blksize = int(attrs.get("block_size", 0))
node = onnx.helper.make_node(
"SpaceToDepth",
input_nodes,
[name],
blocksize=blksize,
name=name,
)
return [node] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_depthtospace(node, **kwargs):\n name, input_nodes, attrs = get_inputs(node, kwargs)\n\n blksize = int(attrs.get(\"block_size\", 0))\n\n node = onnx.helper.make_node(\n \"DepthToSpace\",\n input_nodes,\n [name],\n blocksize=blksize,\n name=name,\n )\n re... | [
"0.6864339",
"0.5582542",
"0.5029747",
"0.5017303",
"0.49569693",
"0.49251297",
"0.4901449",
"0.4830856",
"0.48081103",
"0.48042098",
"0.480372",
"0.4798086",
"0.4687717",
"0.46674845",
"0.4647743",
"0.4614791",
"0.45717818",
"0.455431",
"0.45452812",
"0.45188713",
"0.4509976... | 0.6642687 | 1 |
Map MXNet's sum operator attributes to onnx's ReduceSum operator and return the created node. | def convert_sum(node, **kwargs):
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 None
keepdims = get_boolean_attribute_value(attrs, "keepdims")
if axes:
node = onnx.helper.make_no... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_addn(node, **kwargs):\n return create_basic_op_node('Sum', node, kwargs)",
"def with_sum_sum_reduction(self):\n return self.with_reduction(lambda x: x.sum())",
"def sum(x, reduce_instance_dims=True, name=None): # pylint: disable=redefined-builtin\n return _numeric_combine(x, np.sum, red... | [
"0.6900051",
"0.6317507",
"0.6197959",
"0.61500716",
"0.60951954",
"0.60030466",
"0.5988547",
"0.5975774",
"0.5914605",
"0.58477676",
"0.5730659",
"0.5723871",
"0.56718594",
"0.5667977",
"0.5665367",
"0.5665367",
"0.5665367",
"0.5665367",
"0.5665367",
"0.56367636",
"0.5594987... | 0.7541393 | 0 |
Map MXNet's shape_array operator attributes to onnx's Shape operator and return the created node. | def convert_shape(node, **kwargs):
return create_basic_op_node('Shape', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ashape(node):\n shp = node.shape\n assert shp is not None\n return shp",
"def create_helper_shape_node(input_name, output_name):\n shape_node = onnx.helper.make_node(\n \"Shape\",\n inputs=[input_name],\n outputs=[output_name],\n name=output_name,\n )\n return [s... | [
"0.6381112",
"0.6290396",
"0.61286956",
"0.60487986",
"0.6037103",
"0.5871047",
"0.57438403",
"0.5713804",
"0.57093483",
"0.5691644",
"0.5663834",
"0.56613344",
"0.5644378",
"0.5637776",
"0.56361204",
"0.56357217",
"0.562241",
"0.56134427",
"0.56105673",
"0.55175805",
"0.5502... | 0.6979719 | 0 |
Map MXNet's broadcast_lesser operator attributes to onnx's Less operator and return the created node. | def convert_broadcast_lesser(node, **kwargs):
return create_basic_op_node('Less', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_broadcast_greater(node, **kwargs):\n return create_basic_op_node('Greater', node, kwargs)",
"def test_less_than_bcast(self):\n utils.compare_tracing_methods(\n SimpleCompareOpsModule(\"lessThan\"),\n torch.randn(3, 4, 5),\n torch.randn(4, 5),\n fu... | [
"0.5858624",
"0.5801406",
"0.5520665",
"0.5515037",
"0.54783213",
"0.5373597",
"0.5251242",
"0.5212264",
"0.520232",
"0.5198165",
"0.5109519",
"0.51010454",
"0.5100173",
"0.5031007",
"0.5028119",
"0.50162864",
"0.49891058",
"0.49844187",
"0.4968322",
"0.49516803",
"0.49433753... | 0.85602987 | 0 |
Map MXNet's broadcast_greater operator attributes to onnx's Greater operator and return the created node. | def convert_broadcast_greater(node, **kwargs):
return create_basic_op_node('Greater', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_greater_than_bcast(self):\n utils.compare_tracing_methods(\n SimpleCompareOpsModule(\"greaterThan\"),\n torch.randn(3, 4, 5),\n torch.randn(4, 5),\n fusible_ops={\"aten::gt\"},\n )",
"def greater_than(self) -> global___Expression:",
"def greate... | [
"0.636679",
"0.6333078",
"0.60892975",
"0.60536104",
"0.5972537",
"0.59382397",
"0.5819084",
"0.57593983",
"0.5737228",
"0.56998545",
"0.56720966",
"0.5599701",
"0.55706614",
"0.55538386",
"0.54705316",
"0.53752804",
"0.53341436",
"0.5307528",
"0.52884525",
"0.5286231",
"0.52... | 0.8361962 | 0 |
Map MXNet's broadcast_equal operator attributes to onnx's Equal operator and return the created node. | def convert_broadcast_equal(node, **kwargs):
return create_basic_op_node('Equal', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_equal_bcast(self):\n utils.compare_tracing_methods(\n SimpleCompareOpsModule(\"equal\"),\n torch.randn(3, 4, 5),\n torch.randn(4, 5),\n fusible_ops={\"aten::eq\"},\n )",
"def convert_broadcast_logical_xor(node, **kwargs):\n return create_basic... | [
"0.593598",
"0.56330514",
"0.5556243",
"0.53851575",
"0.5349817",
"0.52744114",
"0.5272917",
"0.5226989",
"0.5213488",
"0.51595694",
"0.51184994",
"0.50618356",
"0.5043084",
"0.4965128",
"0.4951298",
"0.49477023",
"0.49306282",
"0.49269903",
"0.49220464",
"0.4916875",
"0.4910... | 0.79504997 | 0 |
Map MXNet's broadcast logical or operator attributes to onnx's Or operator and return the created node. | def convert_broadcast_logical_or(node, **kwargs):
return create_basic_op_node('Or', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_broadcast_logical_xor(node, **kwargs):\n return create_basic_op_node('Xor', node, kwargs)",
"def convert_broadcast_logical_and(node, **kwargs):\n return create_basic_op_node('And', node, kwargs)",
"def create_net(self, shape1, shape2, ir_version):\n\n #\n # Create ONNX model\n... | [
"0.6557331",
"0.59182656",
"0.58574575",
"0.5785354",
"0.5779746",
"0.5683941",
"0.563225",
"0.5597137",
"0.5566193",
"0.5559112",
"0.55208814",
"0.5506325",
"0.5495919",
"0.5447485",
"0.54401416",
"0.54356146",
"0.54324657",
"0.54322755",
"0.5418937",
"0.54083866",
"0.540492... | 0.76808363 | 0 |
Map MXNet's broadcast logical xor operator attributes to onnx's Xor operator and return the created node. | def convert_broadcast_logical_xor(node, **kwargs):
return create_basic_op_node('Xor', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_broadcast_logical_or(node, **kwargs):\n return create_basic_op_node('Or', node, kwargs)",
"def xor(self, *args):\n return Xor(self, *args)",
"def xor_network():\n # fmt: off\n tpm = np.array([\n [0, 0, 0],\n [0, 1, 1],\n [1, 0, 1],\n [1, 1, 0],\n [... | [
"0.738217",
"0.64635605",
"0.6400872",
"0.62084186",
"0.5969626",
"0.59505045",
"0.59500635",
"0.58331794",
"0.58050483",
"0.57880586",
"0.56789726",
"0.5678336",
"0.5673798",
"0.567273",
"0.5661514",
"0.5651046",
"0.5638466",
"0.5637232",
"0.55427027",
"0.5538561",
"0.548832... | 0.79945916 | 0 |
Map MXNet's logical not operator attributes to onnx's Not operator and return the created node. | def convert_logical_not(node, **kwargs):
return create_basic_op_node('Not', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_logical_not(g, op, block):\n\n ipt0 = g.get_node(op.input(\"X\")[0])\n op_func = get_relay_op(op.type)\n out = op_func(ipt0)\n g.add_node(op.output(\"Out\")[0], out)",
"def logical_not(data):\n return _make.logical_not(data)",
"def bitwise_not(self) -> ColumnOperators:\n\n ret... | [
"0.75782496",
"0.6934414",
"0.6626711",
"0.65900564",
"0.64096093",
"0.6354542",
"0.6351578",
"0.6329878",
"0.62601715",
"0.6213624",
"0.6126839",
"0.60965776",
"0.60675186",
"0.60501796",
"0.60501796",
"0.60501796",
"0.60501796",
"0.60501796",
"0.60476726",
"0.60350335",
"0.... | 0.8060194 | 0 |
Map MXNet's size_array operator attributes to onnx's Size operator and return the created node. | def convert_size(node, **kwargs):
return create_basic_op_node('Size', node, kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_size(g, op, block):\n\n input_x = g.get_node(op.input(\"Input\")[0])\n out = _op.ndarray_size(input_x, dtype=\"int64\")\n out = _op.expand_dims(out, axis=0)\n g.add_node(op.output(\"Out\")[0], out)",
"def arraySize( cls, value, typeCode = None ):\n return value.size",
"def _t... | [
"0.6672948",
"0.59488493",
"0.5767115",
"0.5739616",
"0.5733506",
"0.57241845",
"0.5683179",
"0.56279117",
"0.5627782",
"0.55931187",
"0.5568864",
"0.5536573",
"0.55343175",
"0.5522237",
"0.55192995",
"0.5505195",
"0.55028814",
"0.5481147",
"0.54725236",
"0.54569185",
"0.5453... | 0.6832319 | 0 |
Map MXNet's log_softmax operator attributes to onnx's LogSoftMax operator and return the created node. | def convert_logsoftmax(node, **kwargs):
name, input_nodes, attrs = get_inputs(node, kwargs)
# Converting to int
axis = int(attrs.get("axis", -1))
temp = attrs.get("temperature", 'None')
if temp != 'None':
raise AttributeError("LogSoftMax: ONNX supports only temperature=None")
node = on... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_softmax(cls, op, op_t):\n node = cls._common_singa_tensor_to_onnx_node(op, op_t)\n\n node.attribute.extend([\n helper.make_attribute('axis', op.axis),\n ])\n return node",
"def convert_logsoftmax(g, op, block):\n\n x = g.get_node(op.input(\"X\")[0])\n axis... | [
"0.72433263",
"0.6945794",
"0.6428142",
"0.63807946",
"0.6325919",
"0.62042975",
"0.6159842",
"0.60255045",
"0.5992672",
"0.58925354",
"0.5820617",
"0.5788801",
"0.5781208",
"0.55802464",
"0.55784833",
"0.5528118",
"0.55134857",
"0.55087835",
"0.5452463",
"0.5428512",
"0.5405... | 0.75760037 | 0 |
Map MXNet's norm operator attributes to onnx's ReduceL1 and ReduceL2 operators and return the created node. | def convert_norm(node, **kwargs):
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 else None
keepdims = get_boolean_attribute_value(attrs, "keepdims")
ord = int(attrs.get("ord", 2))
onnx_op_name = "Red... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_norm(g, op, block):\n\n x = g.get_node(op.input(\"X\")[0])\n axis = op.attr(\"axis\")\n axis_l = [axis]\n epsilon = op.attr(\"epsilon\")\n out = _op.nn.l2_normalize(x, epsilon, axis_l)\n g.add_node(op.output(\"Out\")[0], out)",
"def convert_l2normalization(node, **kwargs):\n name... | [
"0.5756237",
"0.56087494",
"0.5600301",
"0.55728614",
"0.55290496",
"0.54875606",
"0.5486537",
"0.5459905",
"0.53227746",
"0.52392274",
"0.5229864",
"0.5215761",
"0.52136004",
"0.5174905",
"0.5169228",
"0.5152919",
"0.5142199",
"0.51399326",
"0.51165926",
"0.5102471",
"0.5090... | 0.7403831 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.