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

Method AddSubstep

caffe2/python/core.py:2776–2790  ·  view source on GitHub ↗
(self, substep)

Source from the content-addressed store, hash-verified

2774 self._step.report_interval = report_interval
2775
2776 def AddSubstep(self, substep):
2777 self._assert_can_mutate()
2778 assert not self.HasNets(), 'Cannot have both network and substeps.'
2779 if isinstance(substep, ExecutionStep):
2780 substep._notify_is_used()
2781 if not substep.HasNets() and not substep.HasSubsteps():
2782 return self
2783 for net in substep.Nets():
2784 _add_net_to_dict(self._net_dict, net)
2785 self._substeps.append(substep)
2786 proto = substep.Proto()
2787 else:
2788 proto = substep
2789 self._step.substep.add().CopyFrom(proto)
2790 return self
2791
2792 def SetConcurrentSubsteps(self, concurrent_substeps):
2793 self._assert_can_mutate()

Callers 2

execution_stepFunction · 0.95

Calls 10

_assert_can_mutateMethod · 0.95
HasNetsMethod · 0.95
isinstanceFunction · 0.85
_add_net_to_dictFunction · 0.85
_notify_is_usedMethod · 0.80
HasSubstepsMethod · 0.80
NetsMethod · 0.45
appendMethod · 0.45
ProtoMethod · 0.45
addMethod · 0.45