80d314ae5eaadc88061a62c827e1b8670098c1ab,rllib/utils/exploration/random.py,Random,get_tf_exploration_action_op,#Random#Any#Any#,56

Before Change



    @tf_function(tf)
    def get_tf_exploration_action_op(self, action_dist, explore):
        if explore:
            action = tf.py_function(self.action_space.sample, [],
                                    self.dtype_sample)
            // Will be unnecessary, once we support batch/time-aware Spaces.
            action = tf.expand_dims(tf.cast(action, dtype=self.dtype), 0)
        else:
            action = tf.cast(
                action_dist.deterministic_sample(), dtype=self.dtype)

        // TODO(sven): Move into (deterministic_)sample(logp=True|False)
        if isinstance(action, TupleActions):
            batch_size = tf.shape(action[0][0])[0]
        else:
            batch_size = tf.shape(action)[0]

After Change


            return tf.cast(
                action_dist.deterministic_sample(), dtype=self.dtype)

        action = tf.cond(
            pred=tf.constant(explore, dtype=tf.bool)
            if isinstance(explore, bool) else explore,
            true_fn=true_fn,
            false_fn=false_fn)

        // TODO(sven): Move into (deterministic_)sample(logp=True|False)
        if isinstance(action, TupleActions):
            batch_size = tf.shape(action[0][0])[0]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


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


Project Name: brightmart/text_classification
Commit Name: a4697b180d4d8f5a7debbf292b6b34cbbbc4df87
Time: 2018-11-23
Author: brightmart@hotmail.com
File Name: a00_Bert/bert_modeling.py
Class Name: BertModel
Method Name: __init__


Project Name: tensorflow/models
Commit Name: 5cee7220217599ceccb191adf430eb914d148f87
Time: 2020-09-17
Author: tanzheny@google.com
File Name: official/vision/keras_cv/ops/box_matcher.py
Class Name: BoxMatcher
Method Name: __call__


Project Name: broadinstitute/keras-rcnn
Commit Name: df93c4e61e7ca1db25f1ee346ac0516685498b02
Time: 2017-08-15
Author: allen.goodman@icloud.com
File Name: keras_rcnn/backend/tensorflow_backend.py
Class Name:
Method Name: bbox_transform_inv