b28653e110ad2bf780fb0cf083718f4a337a57bb,tensorflow_ranking/python/utils.py,,shuffle_valid_indices,#Any#Any#,71

Before Change


    [batch_size, list_size] tensor. The values in the last dimension are the
    indices for an element in the input tensor.
  
  is_valid = ops.convert_to_tensor(is_valid)
  is_valid.get_shape().assert_has_rank(2)
  output_shape = array_ops.shape(is_valid)
  rand = array_ops.where(is_valid,
                         random_ops.random_uniform(output_shape, seed=seed),
                         array_ops.ones(output_shape) * -1e-6)
  // shape(indices) = [batch_size, list_size]
  _, indices = nn_ops.top_k(rand, output_shape[1], sorted=True)
  // shape(batch_ids) = [batch_size, list_size]
  batch_ids = array_ops.ones_like(indices) * array_ops.expand_dims(

After Change



def shuffle_valid_indices(is_valid, seed=None):
  Returns a shuffle of indices with valid ones on top.
  return organize_valid_indices(is_valid, shuffle=True, seed=seed)


def organize_valid_indices(is_valid, shuffle=True, seed=None):
  Organizes indices in such a way that valid items appear first.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: tensorflow/ranking
Commit Name: b28653e110ad2bf780fb0cf083718f4a337a57bb
Time: 2019-01-14
Author: bruch@google.com
File Name: tensorflow_ranking/python/utils.py
Class Name:
Method Name: shuffle_valid_indices


Project Name: broadinstitute/keras-rcnn
Commit Name: 625fbd05fef5c015c9b0e9cedbf12f639a6b5a76
Time: 2020-05-19
Author: allen.goodman@icloud.com
File Name: keras_rcnn/backend/tensorflow_backend.py
Class Name:
Method Name: scatter_add_tensor


Project Name: horovod/horovod
Commit Name: af0153c72ff9ecd34db7db1d6c984cac44646bd0
Time: 2018-12-14
Author: tgaddair@gmail.com
File Name: horovod/tensorflow/__init__.py
Class Name: DistributedOptimizer
Method Name: compute_gradients


Project Name: Microsoft/nni
Commit Name: 55b557f17385ca10b8a3e8fb8bbb0d3799906db5
Time: 2019-11-20
Author: 38930155+chicm-ms@users.noreply.github.com
File Name: src/sdk/pynni/nni/compression/tensorflow/builtin_pruners.py
Class Name: FPGMPruner
Method Name: _get_min_gm_kernel_idx