def test_Conv3D_pickle(): tg = TensorGraph() feature = Feature(shape=(tg.batch_size, 10, 10, 10, 1)) layer = Conv3D(num_outputs=3, in_layers=feature) tg.add_output(layer) tg.set_loss(layer) tg.build() tg.save()
def test_conv_3D(self): """Test that Conv3D can be invoked.""" length = 4 width = 5 depth = 6 in_channels = 2 out_channels = 3 batch_size = 20 in_tensor = np.random.rand(batch_size, length, width, depth, in_channels) with self.session() as sess: in_tensor = tf.convert_to_tensor(in_tensor, dtype=tf.float32) out_tensor = Conv3D(out_channels, kernel_size=1)(in_tensor) sess.run(tf.global_variables_initializer()) out_tensor = out_tensor.eval() assert out_tensor.shape == (batch_size, length, width, depth, out_channels)