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

Method testFCTransposedWithMaxFCSize

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

Source from the content-addressed store, hash-verified

366 train_init_net, train_net = self.get_training_nets()
367
368 def testFCTransposedWithMaxFCSize(self):
369 input_dim = 10
370 output_dim = 30
371 max_length = 20
372 input_record = self.new_record(
373 schema.Struct(
374 ('history_sequence', schema.Scalar((np.float32, (max_length,
375 input_dim)))),
376 )
377 )
378 fc_transposed_out = self.model.FC(
379 input_record.history_sequence, output_dim,
380 max_fc_size=input_dim * output_dim // 2,
381 axis=2, transposed=True)
382 self.model.output_schema = fc_transposed_out
383 self.assertEqual(
384 schema.Scalar((np.float32, (max_length, output_dim))),
385 fc_transposed_out
386 )
387
388 train_init_net, train_net = self.get_training_nets()
389
390 def testSparseLookupSumPoolingWithEviction(self):
391 # Create test embedding table of 1 row

Callers

nothing calls this directly

Calls 4

new_recordMethod · 0.80
FCMethod · 0.80
get_training_netsMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected