1e84cededb34347e5fd3a169b824020606f36d6c,tensorflow_datasets/core/dataset_utils.py,,dataset_as_numpy,#Any#Any#,108

Before Change


    ds_iters = [None] * len(flat_ds)
    with utils.maybe_with_graph(graph, create_if_none=False):
      for i, ds_el in enumerate(flat_ds):
        if isinstance(ds_el, tf.data.Dataset):
          ds_iters[i] = tf.compat.v1.data.make_one_shot_iterator(
              ds_el).get_next()

    // Then create NumPy items
    // Shared session for tf.Tensor runs
    with utils.nogpu_session(graph) as sess:
      for ds_iter, ds_el in zip(ds_iters, flat_ds):
        if ds_iter is None:
          // Tensor

After Change


      // Warning: call sess.run once to that shuffling provide the same values
      // for all keys.
      np_arrays = sess.run([
          ds_el for ds_el in flat_ds
          if not _is_ds(ds_el)
      ])

    // Merge the datasets iterators and np array
    iter_ds = iter(ds_iters)
    iter_array = iter(np_arrays)
    flat_np = [
        next(iter_ds) if _is_ds(ds_el) else next(iter_array)
        for ds_el in flat_ds
    ]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: tensorflow/datasets
Commit Name: 1e84cededb34347e5fd3a169b824020606f36d6c
Time: 2019-01-28
Author: epot@google.com
File Name: tensorflow_datasets/core/dataset_utils.py
Class Name:
Method Name: dataset_as_numpy


Project Name: epfl-lts2/pygsp
Commit Name: eb9c0b11b76b8674cfb5f257ac0c3fc1c72950d5
Time: 2017-08-28
Author: michael.defferrard@epfl.ch
File Name: pygsp/filters/filter.py
Class Name: Filter
Method Name: __init__


Project Name: tensorflow/transform
Commit Name: c3ca2456b96296326aa1d18f33ed72e8dd51ac5b
Time: 2019-09-01
Author: tf-transform-dev@google.com
File Name: tensorflow_transform/analyzers.py
Class Name: QuantilesCombiner
Method Name: merge_accumulators