bc08dbfbe77554bf3458529285003f0bf92eecd3,sonnet/python/modules/nets/vqvae_test.py,VqvaeTest,testShapeChecking,#VqvaeTest#Any#Any#,77

Before Change


    output = vqvae(tf.constant(wrong_shape_input.astype(np.float32)),
                   is_training=False)

    init_op = tf.global_variables_initializer()
    with self.test_session() as session:
      session.run(init_op)
      with self.assertRaisesRegexp(tf.errors.InvalidArgumentError,
                                   "assertion failed"):
        session.run(output)

After Change


  def testShapeChecking(self, constructor, kwargs):
    vqvae = constructor(**kwargs)
    wrong_shape_input = np.random.randn(100, kwargs["embedding_dim"] * 2)
    with self.assertRaisesRegexp(ValueError, "Cannot reshape a tensor"):
      vqvae(tf.constant(wrong_shape_input.astype(np.float32)),
            is_training=False)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: deepmind/sonnet
Commit Name: bc08dbfbe77554bf3458529285003f0bf92eecd3
Time: 2018-07-17
Author: fviola@google.com
File Name: sonnet/python/modules/nets/vqvae_test.py
Class Name: VqvaeTest
Method Name: testShapeChecking


Project Name: GPflow/GPflow
Commit Name: 30a5671297517875caacbf6bd03ae1de0d94ec67
Time: 2017-11-01
Author: art.art.v@gmail.com
File Name: testing/test_mean_functions.py
Class Name: TestSwitchedMeanFunction
Method Name: test


Project Name: tensorlayer/tensorlayer
Commit Name: 910e1e544793c0ca9859a5a4f1c0171104166dc3
Time: 2019-03-10
Author: jingqing.zhang15@imperial.ac.uk
File Name: tests/layers/test_layers_core_basedense_dropout.py
Class Name: Layer_Core_Test
Method Name: test_modellayer