ee44690b0c5c6757eb7eb659fdfff54c4e982da9,mesh_tensorflow/transformer/dataset.py,,pack_and_batch,#Any#Any#Any#Any#,99

Before Change


  )
  dataset = dataset.batch(batch_size, drop_remainder=False)
  // Pad batch size of each batch to batch_size
  dataset = dataset.map(
      functools.partial(trim_and_pad_all_features, length=batch_size),
      num_parallel_calls=tf.data.experimental.AUTOTUNE
  )
  // Remind TensorFlow of the shape
  dataset = dataset.map(
      lambda x: {k: tf.reshape(v, (batch_size, length)) for k, v in x.items()},
      num_parallel_calls=tf.data.experimental.AUTOTUNE

After Change


  if pack:
    dataset = pack_dataset(dataset, length=length)
  // Pad/trim length of each example to length.
  dataset = trim_and_pad_dataset(dataset, length=length),
  dataset = dataset.batch(batch_size, drop_remainder=False)
  // Pad final batch.
  dataset = trim_and_pad_dataset(dataset, length=batch_size),
  dataset = dataset.prefetch(tf.data.experimental.AUTOTUNE)
  return dataset
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: tensorflow/mesh
Commit Name: ee44690b0c5c6757eb7eb659fdfff54c4e982da9
Time: 2019-07-22
Author: adarob@google.com
File Name: mesh_tensorflow/transformer/dataset.py
Class Name:
Method Name: pack_and_batch


Project Name: tensorflow/agents
Commit Name: 46350367a2cda5204cb37f2289021d14064d2d7d
Time: 2018-11-12
Author: kbanoop@google.com
File Name: tf_agents/agents/ddpg/examples/train_eval_mujoco.py
Class Name:
Method Name: train_eval


Project Name: aertslab/pySCENIC
Commit Name: 5b824f9124e8690ce35118cb2ab8ecfe61fad8cc
Time: 2018-02-06
Author: vandesande.bram@gmail.com
File Name: src/pyscenic/regulome.py
Class Name:
Method Name: derive_regulomes


Project Name: tensorflow/models
Commit Name: 64710c051f26a2778c03fc15ef29c4bcae01df32
Time: 2018-08-22
Author: reedwm@google.com
File Name: official/recommendation/data_async_generation.py
Class Name:
Method Name: _construct_training_records