MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _assert_cell_builds

Method _assert_cell_builds

tensorflow/python/kernel_tests/rnn_test.py:340–348  ·  view source on GitHub ↗
(self, cell_class, dtype, batch_size, in_size,
                          out_size)

Source from the content-addressed store, hash-verified

338 self.assertEqual(initial_state.dtype, inputs.dtype)
339
340 def _assert_cell_builds(self, cell_class, dtype, batch_size, in_size,
341 out_size):
342 cell = cell_class(out_size, dtype=dtype)
343 in_shape = tensor_shape.TensorShape((batch_size, in_size))
344 cell.build(in_shape)
345 state_output = cell.get_initial_state(
346 inputs=None, batch_size=batch_size, dtype=dtype)
347 cell_output, _ = cell(array_ops.zeros(in_shape, dtype), state_output)
348 self.assertAllEqual([batch_size, out_size], cell_output.shape.as_list())
349
350 @test_util.run_in_graph_and_eager_modes
351 def testCellsBuild(self):

Callers 1

testCellsBuildMethod · 0.95

Calls 4

buildMethod · 0.65
get_initial_stateMethod · 0.45
assertAllEqualMethod · 0.45
as_listMethod · 0.45

Tested by

no test coverage detected