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

Function CreatePythonOperator

caffe2/python/core.py:444–464  ·  view source on GitHub ↗

`f` should have a signature (inputs, outputs) If `pass_workspace` is True, the signature is changed to (inputs, outputs, workspace) where `workspace` is the workspace the op is going to run on. This is potentially dangerous (as the op can manipulate the workspace directly), use

(
    f, inputs,
    outputs,
    grad_f=None,
    pass_workspace=False,
    python_func_type=None,
    *args,
    **kwargs
)

Source from the content-addressed store, hash-verified

442
443
444def CreatePythonOperator(
445 f, inputs,
446 outputs,
447 grad_f=None,
448 pass_workspace=False,
449 python_func_type=None,
450 *args,
451 **kwargs
452):
453 """
454 `f` should have a signature (inputs, outputs)
455
456 If `pass_workspace` is True, the signature is changed to
457 (inputs, outputs, workspace) where `workspace` is the workspace the op
458 is going to run on. This is potentially dangerous (as the op can manipulate
459 the workspace directly), use on your own risk.
460 """
461 kwargs["token"] = _RegisterPythonImpl(
462 f, grad_f, python_func_type, pass_workspace=pass_workspace
463 )
464 return CreateOperator("Python", inputs, outputs, *args, **kwargs)
465
466
467def GetIndexFromGradientList(g_list, name):

Callers 11

test_feedMethod · 0.90
test_exceptionMethod · 0.90
test_feed_with_gcMethod · 0.90
test_reshapeMethod · 0.90
test_gradientMethod · 0.90
test_simple_python_opMethod · 0.90

Calls 2

_RegisterPythonImplFunction · 0.85
CreateOperatorFunction · 0.85

Tested by 11

test_feedMethod · 0.72
test_exceptionMethod · 0.72
test_feed_with_gcMethod · 0.72
test_reshapeMethod · 0.72
test_gradientMethod · 0.72
test_simple_python_opMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…