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

Method __init__

caffe2/python/core.py:2689–2702  ·  view source on GitHub ↗
(self, name, nets=None, num_iter=None)

Source from the content-addressed store, hash-verified

2687 return name
2688
2689 def __init__(self, name, nets=None, num_iter=None):
2690 self._step = caffe2_pb2.ExecutionStep()
2691 self._step.name = name or ExecutionStep._get_next_step_name('step')
2692 self._net_dict = OrderedDict()
2693 self._is_used = False
2694 self._substeps = []
2695 if nets is not None:
2696 if type(nets) is Net:
2697 nets = [nets]
2698 for net in nets:
2699 if _add_net_to_dict(self._net_dict, net):
2700 self._step.network.extend([get_net_name(net)])
2701 if num_iter is not None:
2702 self._step.num_iter = num_iter
2703
2704 def get_net(self, name):
2705 return self._net_dict[name]

Callers

nothing calls this directly

Calls 4

_add_net_to_dictFunction · 0.85
get_net_nameFunction · 0.85
_get_next_step_nameMethod · 0.80
extendMethod · 0.45

Tested by

no test coverage detected