47c71c0524c7804863f2f4bcffdef5a873d84a55,txtgen/modules/connectors/connectors.py,,_mlp_transform,#Any#Any#Any#,18
Before Change
// get output dimension
iter_output_size = output_size if isinstance(output_size, (list, tuple)) else [output_size]
shape_list = [tf.TensorShape(shape) for shape in iter_output_size]
size_list = [0] * len(shape_list)
for (i, shape) in enumerate(shape_list):
size_list[i] = reduce(lambda x, y: x*y, [dim.value for dim in shape])
sum_output_size = sum(size_list)
After Change
flat_output = tf.split(fc_output, size_list, axis=1)
if isinstance(flat_output_size[0], tf.TensorShape):
for (i, shape) in enumerate(flat_output_size):
new_shape = tf.TensorShape(batch_size).concatenate(shape)
flat_output[i] = tf.reshape(flat_output[i], new_shape)
output = nest.pack_sequence_as(structure=output_size,
flat_sequence=flat_output)
return output
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
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:
Method Name: _mlp_transform
Project Name: OpenNMT/OpenNMT-py
Commit Name: 685126644ae540be72eb662527269a0395e2c9eb
Time: 2017-09-05
Author: bpeters@coli.uni-saarland.de
File Name: onmt/IO.py
Class Name:
Method Name: make_features
Project Name: ray-project/ray
Commit Name: 874da9a25fd4f1d8aac44d29c365fa2143f7793e
Time: 2020-10-01
Author: amogkam@users.noreply.github.com
File Name: python/ray/util/sgd/torch/training_operator.py
Class Name: TrainingOperator
Method Name: register