MCPcopy Create free account
hub / github.com/pytorch/pytorch / __init__

Method __init__

caffe2/python/net_builder.py:33–55  ·  view source on GitHub ↗
(self, name=None, initial_scope=None, _stop_blob_required=False,
                 _stop_blob=None, _fullname=None, _use_control_ops=False)

Source from the content-addressed store, hash-verified

31 step = core.to_execution_step(nb)
32 """
33 def __init__(self, name=None, initial_scope=None, _stop_blob_required=False,
34 _stop_blob=None, _fullname=None, _use_control_ops=False):
35 parent = NetBuilder.current(required=False)
36 assert not _fullname or not name, 'Cannot set both _fullname and name'
37 assert not _use_control_ops or \
38 (not _stop_blob_required and not _stop_blob), \
39 'Stop blobs are not used with control operators'
40 self.name = _fullname or '/'.join(
41 n for n in (parent.name if parent else None, name) if n
42 )
43 self._frozen = False
44 self._current_net = None
45 self._children = []
46 if parent:
47 # make sure parent has an up to date lexical scope computed
48 parent._update_lexical_scope()
49 self._init_lexical_scope = set(parent._lexical_scope) if parent else set()
50 if initial_scope:
51 self._init_lexical_scope |= set([str(b) for b in initial_scope])
52 self._lexical_scope = set(self._init_lexical_scope)
53 self._stop_blob = _stop_blob
54 self._stop_blob_required = _stop_blob_required
55 self._use_control_ops = _use_control_ops
56
57 def stop_blob(self):
58 """

Callers

nothing calls this directly

Calls 3

currentMethod · 0.80
_update_lexical_scopeMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected