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

Method GetCompleteNet

caffe2/python/model_helper.py:451–465  ·  view source on GitHub ↗

r""" Return param_init_net + net Net. Returns: 'core.Net' containing param_init_net and net

(self)

Source from the content-addressed store, hash-verified

449 )))
450
451 def GetCompleteNet(self):
452 r""" Return param_init_net + net Net.
453 Returns:
454 'core.Net' containing param_init_net and net
455 """
456 new_net = self.param_init_net.Clone(
457 self.name + "_complete_net", keep_schema=True)
458 # add init net info to debug info
459 for op in new_net.Proto().op:
460 op.debug_info = op.debug_info + "/param_init_net"
461 new_net.AppendNet(self.net)
462 # keep the execution optimization
463 if self.net.Proto().HasField("type"):
464 new_net.Proto().type = self.net.Proto().type
465 return new_net
466
467 def ConstructInitTrainNetfromNet(self, net):
468 r""" construct init net and train net from complete_net

Callers 2

test_get_complete_netMethod · 0.95

Calls 3

CloneMethod · 0.80
AppendNetMethod · 0.80
ProtoMethod · 0.45

Tested by 2

test_get_complete_netMethod · 0.76