89b081ed3659557e75c8d95a30d1170ddf53cc88,texar/modules/embedders/position_embedders.py,PositionEmbedder,_build,#PositionEmbedder#Any#Any#Any#,102
Before Change
embedding = self._embedding
if self._dropout_layer is not None:
is_training = utils.is_train_mode(mode)
embedding = self._dropout_layer.apply(
inputs=embedding, training=is_training)
inputs = positions
if inputs is None:
if sequence_length is None:
After Change
dropout_layer = self._get_dropout_layer(self._hparams, inputs)
if dropout_layer:
is_training = utils.is_train_mode(mode)
if self._hparams.dropout_strategy == "item_type":
embedding = dropout_layer.apply(
inputs=embedding, training=is_training)
outputs = tf.nn.embedding_lookup(embedding, inputs, **kwargs)
if dropout_layer and self._hparams.dropout_strategy != "item_type":
outputs = dropout_layer.apply(
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances
Project Name: asyml/texar
Commit Name: 89b081ed3659557e75c8d95a30d1170ddf53cc88
Time: 2018-05-28
Author: zhitinghu@gmail.com
File Name: texar/modules/embedders/position_embedders.py
Class Name: PositionEmbedder
Method Name: _build
Project Name: asyml/texar
Commit Name: 89b081ed3659557e75c8d95a30d1170ddf53cc88
Time: 2018-05-28
Author: zhitinghu@gmail.com
File Name: texar/modules/embedders/embedders.py
Class Name: WordEmbedder
Method Name: _build
Project Name: streamlit/streamlit
Commit Name: 370ebd58048e45109d980a3b75e0ca8232c7e9d9
Time: 2018-05-02
Author: adrien.g.treuille@gmail.com
File Name: shared/server/data_frame_proto.py
Class Name:
Method Name: marshall_any_array