89326c618dcf420a79139034b02250a09335ba01,rasa/utils/tensorflow/layers.py,DotProductLoss,_random_indices,#DotProductLoss#Any#Any#,601

Before Change


        // create first random array of indices
        out1 = rand_idxs()  // (1, num_neg)

        return tf.nest.map_structure(
            tf.stop_gradient,
            tf.while_loop(
                cond,
                body,

After Change


        self, batch_size: tf.Tensor, total_candidates: tf.Tensor
    ) -> tf.Tensor:
        return tf.random.uniform(
            shape=(batch_size, self.num_neg), maxval=total_candidates, dtype=tf.int32
        )

    @staticmethod
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: RasaHQ/rasa
Commit Name: 89326c618dcf420a79139034b02250a09335ba01
Time: 2021-01-26
Author: mr.voov@gmail.com
File Name: rasa/utils/tensorflow/layers.py
Class Name: DotProductLoss
Method Name: _random_indices


Project Name: tensorflow/privacy
Commit Name: ceee90b1acfb5ab44ed40fa45d619a2fbb2a80f2
Time: 2018-12-18
Author: gardener@tensorflow.org
File Name: privacy/optimizers/gaussian_average_query.py
Class Name: GaussianAverageQuery
Method Name: get_noised_average


Project Name: tensorflow/agents
Commit Name: 61fbaff7635bb78a6fed0c2b1baea6405e413209
Time: 2020-06-23
Author: no-reply@google.com
File Name: tf_agents/policies/fixed_policy.py
Class Name: FixedPolicy
Method Name: _action


Project Name: tensorflow/agents
Commit Name: 61fbaff7635bb78a6fed0c2b1baea6405e413209
Time: 2020-06-23
Author: no-reply@google.com
File Name: tf_agents/policies/fixed_policy.py
Class Name: FixedPolicy
Method Name: _distribution