b045ce7d71c64336e34589d20993bbbed2399806,official/nlp/xlnet_modeling.py,TransformerXLModel,call,#TransformerXLModel#Any#,774
Before Change
cat_ids = tf.concat([mem_pad, seg_id], 0)
// `1` indicates not in the same segment [qlen x klen x bsz]
seg_mat = tf.cast(
tf.logical_not(tf.equal(seg_id[:, None], cat_ids[None, :])),
tf.int32)
seg_mat = tf.one_hot(seg_mat, 2, dtype=self.tf_float)
else:
seg_mat = None
After Change
// `1` indicates not in the same segment [qlen x klen x bsz]
// seg_id: [qlen x bsz] & cat_id: [klen x bsz]
cls_mat = tf.logical_or(
tf.equal(seg_id, tf.constant([data_utils.SEG_ID_CLS]))[:, None],
tf.equal(cat_id, tf.constant([data_utils.SEG_ID_CLS]))[None, :])
seg_mat = tf.equal(seg_id[:, None], cat_id[None, :])
seg_mat = tf.logical_or(cls_mat, seg_mat)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: tensorflow/models
Commit Name: b045ce7d71c64336e34589d20993bbbed2399806
Time: 2019-10-03
Author: hongkuny@google.com
File Name: official/nlp/xlnet_modeling.py
Class Name: TransformerXLModel
Method Name: call
Project Name: tensorflow/transform
Commit Name: 7495a78668fb2321872fde585e4ef2aa6b74ede1
Time: 2019-05-31
Author: kestert@google.com
File Name: tensorflow_transform/saved/saved_transform_io_test.py
Class Name: SavedTransformIOTest
Method Name: test_table_roundtrip
Project Name: ray-project/ray
Commit Name: 80d314ae5eaadc88061a62c827e1b8670098c1ab
Time: 2020-03-12
Author: sven@anyscale.io
File Name: rllib/utils/exploration/random.py
Class Name: Random
Method Name: get_tf_exploration_action_op