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

Method testFCWithoutBias

caffe2/python/layers_test.py:212–244  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

210 return ops_output
211
212 def testFCWithoutBias(self):
213 output_dims = 2
214 fc_without_bias = self.model.FCWithoutBias(
215 self.model.input_feature_schema.float_features, output_dims)
216 self.model.output_schema = fc_without_bias
217
218 self.assertEqual(
219 schema.Scalar((np.float32, (output_dims, ))),
220 fc_without_bias
221 )
222
223 train_init_net, train_net = self.get_training_nets()
224
225 init_ops = self.assertNetContainOps(
226 train_init_net,
227 [
228 OpSpec("UniformFill", None, None),
229 ]
230 )
231
232 mat_mul_spec = OpSpec(
233 "MatMul",
234 [
235 self.model.input_feature_schema.float_features(),
236 init_ops[0].output[0],
237 ],
238 fc_without_bias.field_blobs()
239 )
240
241 self.assertNetContainOps(train_net, [mat_mul_spec])
242
243 predict_net = self.get_predict_net()
244 self.assertNetContainOps(predict_net, [mat_mul_spec])
245
246 def testFCWithBootstrap(self):
247 output_dims = 1

Callers

nothing calls this directly

Calls 6

OpSpecClass · 0.90
get_training_netsMethod · 0.80
assertNetContainOpsMethod · 0.80
get_predict_netMethod · 0.80
assertEqualMethod · 0.45
field_blobsMethod · 0.45

Tested by

no test coverage detected