Esempio n. 1
0
def test_Conv3DTranspose_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 10, 10, 10, 1))
  layer = Conv3DTranspose(num_outputs=3, in_layers=feature)
  tg.add_output(layer)
  tg.set_loss(layer)
  tg.build()
  tg.save()
Esempio n. 2
0
 def test_conv_3D_transpose(self):
   """Test that Conv3DTranspose 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 = Conv3DTranspose(
         out_channels, kernel_size=1, stride=(2, 3, 1))(in_tensor)
     sess.run(tf.global_variables_initializer())
     out_tensor = out_tensor.eval()
     assert out_tensor.shape == (batch_size, 2 * length, 3 * width, depth,
                                 out_channels)