47c71c0524c7804863f2f4bcffdef5a873d84a55,txtgen/modules/connectors/connectors.py,StochasticConnector,_build,#StochasticConnector#,321
Before Change
output = distribution.sample(batch_size)
if len(output.get_shape()) == 1:
output = tf.reshape(output, [batch_size, 1])
// Disable gradients through samples
output = tf.stop_gradient(output)
After Change
if batch_size:
output = dist_instance.sample(batch_size)
else:
output = dist_instance.sample()
if dist_instance.event_shape == []:
output = tf.reshape(output,
output.shape.concatenate(tf.TensorShape(1)))
// Disable gradients through samples
output = tf.stop_gradient(output)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: asyml/texar
Commit Name: 47c71c0524c7804863f2f4bcffdef5a873d84a55
Time: 2017-10-16
Author: junxianh2@gmail.com
File Name: txtgen/modules/connectors/connectors.py
Class Name: StochasticConnector
Method Name: _build
Project Name: deepmind/sonnet
Commit Name: bc08dbfbe77554bf3458529285003f0bf92eecd3
Time: 2018-07-17
Author: fviola@google.com
File Name: sonnet/python/modules/nets/vqvae.py
Class Name: VectorQuantizerEMA
Method Name: _build
Project Name: deepmind/sonnet
Commit Name: bc08dbfbe77554bf3458529285003f0bf92eecd3
Time: 2018-07-17
Author: fviola@google.com
File Name: sonnet/python/modules/nets/vqvae.py
Class Name: VectorQuantizer
Method Name: _build