51498b09368a61bfb06849693688df6eb54d4787,python/eight_mile/tf/embeddings.py,LearnedPositionalLookupTableEmbeddings,encode,#LearnedPositionalLookupTableEmbeddings#Any#,519
Before Change
T = tf.shape(x)[1]
e0 = tf.compat.v1.scatter_update(self.pos, tf.constant(0, dtype=tf.int32, shape=[1]), tf.zeros(shape=[1, self.dsz]))
with tf.control_dependencies([e0]):
pos_embeddings = tf.nn.embedding_lookup(self.pos, tf.range(T, dtype=tf.int32))
return x + tf.expand_dims(pos_embeddings, 0)
def detached_ref(self):
After Change
x = super().encode(x)
T = tf.shape(x)[1]
pos = self.positional(T)
return self.dropout(x + pos, training=TRAIN_FLAG())
class PositionalCharConvEmbeddings(SinusoidalPositionalMixin, CharConvEmbeddings):
def __init__(self, trainable=True, name=None, dtype=tf.float32, **kwargs):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: dpressel/mead-baseline
Commit Name: 51498b09368a61bfb06849693688df6eb54d4787
Time: 2019-11-14
Author: blester125@gmail.com
File Name: python/eight_mile/tf/embeddings.py
Class Name: LearnedPositionalLookupTableEmbeddings
Method Name: encode
Project Name: osmr/imgclsmob
Commit Name: ea3df12ee5874a63875338289ce15ed94b103afd
Time: 2020-01-17
Author: osemery@gmail.com
File Name: pytorch/pytorchcv/models/hardnet.py
Class Name: HarDStage
Method Name: forward
Project Name: dpressel/mead-baseline
Commit Name: 51498b09368a61bfb06849693688df6eb54d4787
Time: 2019-11-14
Author: blester125@gmail.com
File Name: python/eight_mile/tf/embeddings.py
Class Name: LearnedPositionalCharConvEmbeddings
Method Name: encode