f1d2a776dfa29bf08a8a13745be82e7d6788e365,keras/layers/dense_attention.py,BaseDenseAttention,_apply_scores,#BaseDenseAttention#Any#Any#Any#Any#,93

Before Change


    if scores_mask is not None:
      padding_mask = tf.logical_not(scores_mask)
      // Bias so padding positions do not contribute to attention distribution.
      scores -= 1.e9 * tf.cast(padding_mask, dtype=K.floatx())
    if training is None:
      training = K.learning_phase()
    weights = tf.compat.v1.math.softmax(scores)

After Change


      if scores.dtype is tf.float16:
        scores -= 65504. * tf.cast(padding_mask, dtype=scores.dtype)
      else:
        scores -= 1.e9 * tf.cast(padding_mask, dtype=scores.dtype)
    if training is None:
      training = K.learning_phase()
    weights = tf.compat.v1.math.softmax(scores)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: keras-team/keras
Commit Name: f1d2a776dfa29bf08a8a13745be82e7d6788e365
Time: 2021-01-25
Author: scottzhu@google.com
File Name: keras/layers/dense_attention.py
Class Name: BaseDenseAttention
Method Name: _apply_scores


Project Name: NeuromorphicProcessorProject/snn_toolbox
Commit Name: 2a64a9d6d97a5c203bd58c0d039eb7e63c07e80f
Time: 2020-09-28
Author: bodo.rueckauer@gmail.com
File Name: snntoolbox/simulation/backends/inisim/ttfs.py
Class Name: SpikeMaxPooling2D
Method Name: call


Project Name: NeuromorphicProcessorProject/snn_toolbox
Commit Name: 2a64a9d6d97a5c203bd58c0d039eb7e63c07e80f
Time: 2020-09-28
Author: bodo.rueckauer@gmail.com
File Name: snntoolbox/simulation/backends/inisim/ttfs.py
Class Name: SpikeLayer
Method Name: update_neurons