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

Before Change


    // 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
          np_el = sess.run(ds_el)
        else:
          // Dataset
          np_el = _graph_dataset_iterator(ds_iter, graph)
        flat_np.append(np_el)

  // Nest
  return tf.contrib.framework.nest.pack_sequence_as(nested_ds, flat_np)

After Change


    // 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
    ]

  // Nest
  return tf.contrib.framework.nest.pack_sequence_as(nested_ds, flat_np)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

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: biocore/scikit-bio
Commit Name: abf119a4f4b015534f6e159461f9fc71abbd16e8
Time: 2014-06-25
Author: mcdonadt@colorado.edu
File Name: skbio/core/tree/tests/test_util.py
Class Name: UtilTests
Method Name: test_shuffle_complex


Project Name: mathics/Mathics
Commit Name: a5ca410dfe2f15272f0f963e1ebc4d3f5228f088
Time: 2016-08-13
Author: 16sn6uv@gmail.com
File Name: mathics/builtin/numeric.py
Class Name: Rationalize
Method Name: approx_interval_continued_fraction