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

Method get_training_nets

caffe2/python/layer_test_util.py:59–73  ·  view source on GitHub ↗

We don't use layer_model_instantiator.generate_training_nets_forward_only() here because it includes initialization of global constants, which make testing tricky

(self, add_constants=False)

Source from the content-addressed store, hash-verified

57 return schema.NewRecord(self.model.net, schema_obj)
58
59 def get_training_nets(self, add_constants=False):
60 """
61 We don't use
62 layer_model_instantiator.generate_training_nets_forward_only()
63 here because it includes initialization of global constants, which make
64 testing tricky
65 """
66 train_net = core.Net('train_net')
67 if add_constants:
68 train_init_net = self.model.create_init_net('train_init_net')
69 else:
70 train_init_net = core.Net('train_init_net')
71 for layer in self.model.layers:
72 layer.add_operators(train_net, train_init_net)
73 return train_init_net, train_net
74
75 def get_eval_net(self):
76 return layer_model_instantiator.generate_eval_net(self.model)

Callers 15

test_log_barrierMethod · 0.80
test_group_l1_normMethod · 0.80
test_l1_norm_trimmedMethod · 0.80
test_fp16_max_normMethod · 0.80
testFCWithoutBiasMethod · 0.80
testFCWithBootstrapMethod · 0.80
testFCwithAxis2Method · 0.80
testFCTransposedMethod · 0.80

Calls 3

NetMethod · 0.80
create_init_netMethod · 0.80
add_operatorsMethod · 0.80

Tested by

no test coverage detected