MCPcopy Index your code
hub / github.com/pytorch/pytorch / call

Function call

caffe2/python/net_printer.py:252–268  ·  view source on GitHub ↗
(op, inputs=None, outputs=None, factor_prefixes=False)

Source from the content-addressed store, hash-verified

250
251
252def call(op, inputs=None, outputs=None, factor_prefixes=False):
253 if not inputs:
254 inputs = ''
255 else:
256 inputs_v = [a for a in inputs if not isinstance(a, tuple)]
257 inputs_kv = [a for a in inputs if isinstance(a, tuple)]
258 inputs = ', '.join(
259 x
260 for x in chain(
261 [factor_prefix(inputs_v, factor_prefixes)],
262 ('%s=%s' % kv for kv in inputs_kv),
263 )
264 if x
265 )
266 call = '%s(%s)' % (op, inputs)
267 return call if not outputs else '%s = %s' % (
268 factor_prefix(outputs, factor_prefixes), call)
269
270
271def format_device_option(dev_opt):

Callers 11

benchmark_fused_nodesMethod · 0.85
test_factory_kwargsMethod · 0.85
format_device_optionFunction · 0.85
print_opFunction · 0.85
print_net_defFunction · 0.85
_get_step_contextFunction · 0.85
print_stepFunction · 0.85
print_taskFunction · 0.85
print_task_groupFunction · 0.85
op_gen.pyFile · 0.85

Calls 4

isinstanceFunction · 0.85
chainFunction · 0.85
factor_prefixFunction · 0.85
joinMethod · 0.45

Tested by 2

test_factory_kwargsMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…