|
def | RefreshRegisteredOperators () |
|
def | GlobalInit (args) |
|
def | GetGlobalInitArgs () |
|
def | worker_init_func (func) |
|
def | GetWorkerInitCalls () |
|
def | IsOperator (op_type) |
|
def | IsOperatorWithEngine (op_type, engine) |
|
def | DeviceOption (device_type, cuda_gpu_id=0, random_seed=None) |
|
def | ScopedName (name) |
|
def | ScopedBlobReference (name, args, kwargs) |
|
def | CreateOperator (operator_type, inputs, outputs, name='', control_input=None, device_option=None, arg=None, engine=None, kwargs) |
|
def | CreatePythonOperator (f, inputs, outputs, grad_f=None, pass_workspace=False, args, kwargs) |
|
def | GetIndexFromGradientList (g_list, name) |
|
def | get_ssa (net, blob_versions=None) |
|
def | get_undefined_blobs (ssa) |
|
def | get_output_producers (ssa) |
|
def | get_op_ids_in_path (ssa, blob_versions, inputs, outputs) |
|
def | clone_and_bind_net (net, name, prefix, blob_remap=None, inputs=None, keep_schema=True) |
|
def | get_net_name (netlike) |
|
def | output_to_list (op_output) |
|
def | add_nets_in_order (step, net_list) |
|
def | to_execution_step (step_or_nets, default_name=None) |
|
def | execution_step (default_name, steps_or_nets, num_iter=None, report_net=None, report_interval=None, concurrent_substeps=None, should_stop_blob=None, only_once=None) |
|
def | scoped_execution_step (name, args, kwargs) |
|
|
| DeviceScope = scope.DeviceScope |
|
| NameScope = scope.NameScope |
|
| basestring = str |
|
| GradientSlice = namedtuple('GradientSlice', ['indices', 'values']) |
|
| OpSSA = namedtuple('OpSSA', ['op', 'in_versions', 'out_versions']) |
|
| GradGenMeta = namedtuple('GradGenMeta', ['grad_op', 'idx', 'gradient']) |
|
| SparseGradGenMeta |
|
Module caffe2.python.core.
def core.clone_and_bind_net |
( |
|
net, |
|
|
|
name, |
|
|
|
prefix, |
|
|
|
blob_remap = None , |
|
|
|
inputs = None , |
|
|
|
keep_schema = True |
|
) |
| |
Clone the given Net, binding its input schema to the given `inputs` record.
Blob names defined by the net are prepended with the given `prefix`.
Args:
net: the net to clone
name: the name of the new net
prefix: the prefix to append to local blobs
blob_remap: (optional) dict with additional blob name remapping.
inputs: (optional) input record that will provide actual input
values for the cloned net. Must be compatible with the
net's input schema or be a strict superset of it
keep_schema: by default (True), the original schema will be kept and
remapped accordingly. otherwise, the schema will be set as
inputs or left empty if inputs is not given.
Returns:
Tuple (cloned_net, blob_remap)
clone_net: the cloned Net
blob_remap: a map from original blob names into remapped blob names
Definition at line 1057 of file core.py.
def core.CreatePythonOperator |
( |
|
f, |
|
|
|
inputs, |
|
|
|
outputs, |
|
|
|
grad_f = None , |
|
|
|
pass_workspace = False , |
|
|
|
args, |
|
|
|
kwargs |
|
) |
| |
`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 on your own risk.
Definition at line 322 of file core.py.
def core.get_ssa |
( |
|
net, |
|
|
|
blob_versions = None |
|
) |
| |
Given a net, return a structure containing the version of each input and
output blob used by each operator.
Args:
net: either a Net or a NetDef
blob_versions: (optional) map with current version number for given
blob names. If not provided or blob not found, start
from version 0.
Returns:
Tuple (ssa, blob_versions)
ssa: list of tuples (versioned_inputs, versioned_outputs)
for each op in the net. A versioned input is a tuple
(blob_name, version).
blob_versions: updated map with latest version of each blob found in
the net.
Definition at line 969 of file core.py.