d2c47d5834c8484fda791c91db22cf22f2022c26,tensorflow_datasets/core/dataset_utils.py,,build_dataset,#Any#Any#Any#Any#,29
Before Change
// Transpose the list[dict] into dict[list]
tensor_inputs = {
key: list(values) for key, values in utils.zip_dict(*instruction_dicts)
}
// Skip slicing if all masks are True (No value skipped)
if all(all(m) for m in tensor_inputs["mask"]):
After Change
// First case: All examples are taken (No value skipped)
if _no_examples_skipped(instruction_dicts):
// Only use the filenames as instruction
instruction_ds = tf.data.Dataset.from_tensor_slices([
d["filepath"] for d in instruction_dicts
])
build_ds_from_instruction = dataset_from_file_fn
// Second case: Use the instructions to read the examples
else:
instruction_ds = _build_instruction_ds(instruction_dicts)
build_ds_from_instruction = functools.partial(
_build_ds_from_instruction,
ds_from_file_fn=dataset_from_file_fn,
)
// If shuffle is True, we shuffle the instructions/shards
if shuffle_files:
instruction_ds = instruction_ds.shuffle(len(instruction_dicts))
// Use interleave to parallel read files and decode records
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances Project Name: tensorflow/datasets
Commit Name: d2c47d5834c8484fda791c91db22cf22f2022c26
Time: 2019-04-12
Author: epot@google.com
File Name: tensorflow_datasets/core/dataset_utils.py
Class Name:
Method Name: build_dataset
Project Name: Scitator/catalyst
Commit Name: e9905e975cbaf0c71fd7e9aab113e196122c6027
Time: 2020-01-27
Author: tez.romach@gmail.com
File Name: catalyst/dl/utils/criterion/iou.py
Class Name:
Method Name: iou