b3377b098a78e8a2508527f9d71a89b15fef3929,official/nlp/modeling/layers/on_device_embedding.py,OnDeviceEmbedding,call,#OnDeviceEmbedding#Any#,80

Before Change



  def call(self, inputs):
    input_shape = tf_utils.get_shape_list(inputs, expected_rank=2)
    input_shape.append(self._embedding_width)
    flat_inputs = tf.reshape(inputs, [-1])
    if self._use_one_hot:
      one_hot_data = tf.one_hot(
          flat_inputs, depth=self._vocab_size, dtype=self._dtype)

After Change


        embeddings,
        // Work around b/142213824: prefer concat to shape over a Python list.
        tf.concat([tf.shape(inputs), [self._embedding_width]], axis=0))
    embeddings.set_shape(inputs.shape.as_list() + [self._embedding_width])
    return embeddings
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: tensorflow/models
Commit Name: b3377b098a78e8a2508527f9d71a89b15fef3929
Time: 2020-04-20
Author: gardener@tensorflow.org
File Name: official/nlp/modeling/layers/on_device_embedding.py
Class Name: OnDeviceEmbedding
Method Name: call


Project Name: google-research/google-research
Commit Name: 557f9f7648892b0a23a8821c2d5c0a7bb599c5d4
Time: 2020-12-19
Author: liuti@google.com
File Name: poem/core/data_utils.py
Class Name:
Method Name: reshape_by_last_dims


Project Name: deepchem/deepchem
Commit Name: 7c9123131cb9e353ee8f6e1245f41d77f85af713
Time: 2018-08-22
Author: peastman@stanford.edu
File Name: deepchem/models/tensorgraph/layers.py
Class Name: AtomicConvolution
Method Name: create_tensor