Home
last modified time | relevance | path

Searched refs:dataset (Results 1 – 25 of 655) sorted by relevance

12345678910>>...27

/external/tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/
Dautotune_buffer_sizes_test.py32 def _enable_autotune_buffers(self, dataset): argument
35 return dataset.with_options(options)
39 dataset = dataset_ops.Dataset.range(100)
40 dataset = dataset.apply(
42 dataset = dataset.map(
44 dataset = dataset.take(50)
45 dataset = self._enable_autotune_buffers(dataset)
46 self.assertDatasetProduces(dataset, range(1, 51))
50 dataset = dataset_ops.Dataset.range(100)
51 dataset = dataset.apply(
[all …]
Dreorder_data_discarding_ops_test.py35 dataset = dataset_ops.Dataset.range(100)
36 dataset = dataset.apply(
39 dataset = dataset.map(lambda x: x + 1, num_parallel_calls=10)
40 dataset = dataset.skip(10)
41 dataset = dataset.prefetch(1)
42 dataset = dataset.take(50)
43 dataset = dataset.shard(2, 0)
47 dataset = dataset.with_options(options)
48 self.assertDatasetProduces(dataset, range(11, 61, 2))
53 dataset = dataset_ops.Dataset.range(100)
[all …]
Dchoose_fastest_branch_dataset_test.py39 dataset = dataset_ops.Dataset.from_tensor_slices([0, 1, 2, 3, 4])
41 def branch(dataset): argument
42 return dataset.map(lambda x: x)
45 dataset, [branch, branch])
50 expected_shapes=dataset_ops.get_legacy_output_shapes(dataset))
54 dataset = dataset_ops.Dataset.range(10)
59 def branch_0(dataset): argument
60 return dataset.map(lambda x: x + const_64)
62 def branch_1(dataset): argument
63 return dataset.map(lambda x: x + math_ops.cast(const_32, dtypes.int64))
[all …]
/external/tensorflow/tensorflow/python/data/experimental/kernel_tests/
Dauto_shard_dataset_test.py60 def getAllDatasetElements(self, dataset): argument
62 next_fn = self.getNext(dataset)
70 def assertDatasetProducesWithShuffle(self, dataset, expected, batch, argument
74 next_fn = self.getNext(dataset)
86 self.assertDatasetProduces(dataset, list(chunk(expected, batch)))
93 dataset = dataset_ops.Dataset.list_files(
95 dataset = dataset.flat_map(core_readers.TFRecordDataset)
96 dataset = dataset.batch(5)
97 dataset = distribute._AutoShardDataset(dataset, 5, 3)
104 self.assertDatasetProducesWithShuffle(dataset, expected, 5, 4, shuffle)
[all …]
Dprefetch_with_slack_test.py40 dataset = dataset_ops.Dataset.range(10)
41 dataset = dataset.prefetch(1)
44 dataset = dataset.with_options(options)
46 dataset, ["/cpu:1", "/cpu:2"])
47 dataset = multi_device_iterator._dataset # pylint: disable=protected-access
48 self.assertIn("slack", dataset.options()._graph_rewrites().enabled)
50 dataset.options()._graph_rewrite_configs(autotune=True))
67 dataset = dataset_ops.Dataset.range(10)
68 dataset = dataset.prefetch(1)
71 dataset = dataset.with_options(options)
[all …]
Drebatch_dataset_test.py153 def _flat_shapes(dataset): argument
156 for ts in nest.flatten(dataset_ops.get_legacy_output_shapes(dataset))
168 dataset = dataset_ops.Dataset.range(8).batch(4, drop_remainder=True)
170 dataset, batch_sizes=[2, 1, 1])
178 dataset = dataset_ops.Dataset.range(8).batch(4, drop_remainder=True)
180 dataset, batch_sizes=[2, 2], drop_remainder=drop_remainder)
187 dataset = dataset_ops.Dataset.range(8).batch(4, drop_remainder=False)
189 dataset, batch_sizes=[2, 2], drop_remainder=False)
196 dataset = dataset_ops.Dataset.range(8).batch(4, drop_remainder=False)
198 dataset, batch_sizes=[2, 2], drop_remainder=True)
[all …]
Doptimize_dataset_test.py133 dataset = dataset_ops.Dataset.range(
137 dataset = dataset.with_options(options)
138 get_next = self.getNext(dataset)
145 dataset = dataset_ops.Dataset.from_tensors(input_t)
148 dataset = dataset.with_options(options)
149 iterator = dataset_ops.make_initializable_iterator(dataset)
161 dataset = dataset_ops.Dataset.from_tensor_slices(input_t)
164 dataset = dataset.with_options(options)
165 iterator = dataset_ops.make_initializable_iterator(dataset)
177 dataset = dataset_ops.Dataset.from_tensors(0)
[all …]
Dsnapshot_test.py67 def assertDatasetProducesSet(self, dataset, expected): argument
69 next_fn = self.getNext(dataset)
109 dataset = dataset_ops.Dataset.from_tensors([1, 2, 3])
110 dataset.apply(snapshot.snapshot(self._snapshot_dir))
122 dataset = core_readers._TFRecordDataset(filenames)
123 dataset = dataset.apply(snapshot.snapshot(self._snapshot_dir))
124 self.assertDatasetProduces(dataset, expected)
146 dataset = core_readers._TFRecordDataset(filenames)
147 dataset = dataset.apply(
149 self.assertDatasetProduces(dataset, expected)
[all …]
Dnon_serializable_test.py33 dataset = dataset_ops.Dataset.from_tensors(0)
34 dataset = dataset.apply(testing.assert_next(["FiniteSkip"]))
35 dataset = dataset.skip(0) # Should not be removed by noop elimination
36 dataset = dataset.apply(testing.non_serializable())
37 dataset = dataset.apply(testing.assert_next(["MemoryCacheImpl"]))
38 dataset = dataset.skip(0) # Should be removed by noop elimination
39 dataset = dataset.cache()
43 dataset = dataset.with_options(options)
44 self.assertDatasetProduces(dataset, expected_output=[0])
49 dataset = dataset_ops.Dataset.from_tensors(0)
[all …]
/external/tensorflow/tensorflow/python/data/experimental/benchmarks/
Dsnapshot_dataset_benchmark.py48 dataset = dataset_ops.Dataset.from_tensor_slices([1.0])
49 dataset = dataset.map(
51 dataset = dataset.repeat(num_elements)
52 dataset = dataset.apply(
55 return dataset
59 dataset = self._createSimpleDataset(
63 dataset=dataset,
71 dataset = self._createSimpleDataset(
75 dataset=dataset,
83 dataset = self._createSimpleDataset(num_elements=num_elements)
[all …]
Dautotune_benchmark.py31 def _run_benchmark(self, dataset, autotune, autotune_buffers, argument
37 dataset = dataset.with_options(options)
43 dataset=dataset,
61 dataset = dataset_ops.Dataset.from_tensors(
63 dataset = dataset.map(math_ops.matmul)
64 dataset = dataset.batch(
67 dataset,
83 dataset = dataset_ops.Dataset.from_tensors(
85 dataset = dataset.map(
88 dataset=dataset,
[all …]
Dchoose_fastest_benchmark.py30 dataset = dataset_ops.Dataset.range(1000**2).repeat()
33 dataset = dataset.with_options(options)
34 map_batch_dataset = dataset.map(lambda x: x + 1).batch(100)
35 batch_map_dataset = dataset.batch(100).map(lambda x: x + 1)
39 self._benchmark(dataset=map_batch_dataset, name="map_batch_dataset")
40 self._benchmark(dataset=batch_map_dataset, name="batch_map_dataset")
41 self._benchmark(dataset=merge_dataset, name="merge_dataset")
45 dataset = dataset_ops.Dataset.range(1000**2).repeat()
48 dataset = dataset.with_options(options)
49 map_batch_dataset = dataset.map(lambda x: x + 1).batch(100)
[all …]
Dparameter_value_benchmark.py32 dataset = dataset_ops.Dataset.from_tensors(
34 dataset = dataset.map(
36 dataset = dataset.prefetch(buffer_size=buffer_size)
39 dataset=dataset,
66 dataset = dataset_ops.Dataset.from_tensors(
68 dataset = dataset.map(
70 dataset = dataset.batch(batch_size=batch_size)
71 dataset = dataset.prefetch(buffer_size=buffer_size)
74 dataset=dataset,
101 dataset = dataset_ops.Dataset.from_tensors(
[all …]
Doptimize_benchmark.py41 dataset = dataset_ops.Dataset.from_tensors(0).repeat(None)
43 dataset = dataset.map(lambda x: x)
48 dataset = dataset.with_options(options)
52 dataset=dataset,
70 dataset = dataset_ops.Dataset.from_tensors(0).repeat(None)
72 dataset = dataset.map(lambda x: x + 5).filter(
78 dataset = dataset.with_options(options)
82 dataset=dataset,
102 dataset = dataset_ops.Dataset.from_tensors(5).repeat(None)
104 dataset = dataset.filter(lambda x: math_ops.greater_equal(x - 5, 0))
[all …]
/external/tensorflow/tensorflow/python/data/kernel_tests/
Dmap_test.py65 def new_map_fn(dataset, *args, **kwargs): argument
66 return dataset.map(*args, **kwargs)
68 def legacy_map_fn(dataset, *args, **kwargs): argument
69 return dataset.map_with_legacy_function(*args, **kwargs)
86 def new_map_fn(dataset, *args, **kwargs): argument
87 return dataset.map(*args, **kwargs)
150 dataset = dataset_ops.Dataset.range(num_elements)
151 dataset = apply_map(dataset, fn, num_parallel_calls).with_options(options)
152 return dataset, coordination_events
169 dataset = dataset_ops.Dataset.from_tensor_slices(components)
[all …]
Dfrom_tensors_test.py48 dataset = dataset_ops.Dataset.from_tensors(components)
52 nest.flatten(dataset_ops.get_legacy_output_shapes(dataset)))
54 self.assertDatasetProduces(dataset, expected_output=[components])
59 dataset = dataset_ops.Dataset.from_tensors(dataset_ops.Dataset.range(10))
60 dataset = dataset.flat_map(lambda x: x)
61 self.assertDatasetProduces(dataset, expected_output=range(10))
70 dataset = dataset_ops.Dataset.from_tensors(components)
73 dataset, expected_output=[[1.0, 2.0]], requires_initialization=True)
87 dataset = dataset_ops.Dataset.from_tensors(components)
91 [shape for shape in dataset_ops.get_legacy_output_shapes(dataset)])
[all …]
Dfilter_test.py35 def filter_fn(dataset, predicate): argument
36 return dataset.filter(predicate)
38 def legacy_filter_fn(dataset, predicate): argument
39 return dataset.filter_with_legacy_function(predicate)
68 dataset = dataset_ops.Dataset.from_tensor_slices(components).map(
71 dataset = apply_filter(
72 dataset,
77 [shape for shape in dataset_ops.get_legacy_output_shapes(dataset)])
78 get_next = self.getNext(dataset)
95 dataset = dataset_ops.Dataset.range(4)
[all …]
Ddataset_test.py54 dataset = dataset_ops.Dataset.range(10)
56 self.evaluate(dataset._as_serialized_graph()))
60 dataset = dataset_ops.Dataset.range(10).map(
64 dataset._as_serialized_graph(external_state_policy=distribute_options
94 def _testNumInputs(self, dataset, num_inputs): argument
95 self.assertLen(dataset._inputs(), num_inputs)
99 dataset = readers.FixedLengthRecordDataset("", 42)
100 self._testNumInputs(dataset, 0)
107 dataset = dataset_ops.Dataset.from_generator(gen, dtypes.int32)
108 self._testNumInputs(dataset, 1)
[all …]
Dshard_test.py33 dataset = dataset_ops.Dataset.range(10).shard(5, 2)
34 self.assertDatasetProduces(dataset, expected_output=[2, 7])
40 dataset = dataset_ops.Dataset.zip((dataset_a, dataset_b)).shard(5, 2)
41 self.assertDatasetProduces(dataset, expected_output=[(2, 8), (7, 3)])
45 dataset = dataset_ops.Dataset.range(10).shard(5, 0)
46 self.assertDatasetProduces(dataset, expected_output=[0, 5])
51 dataset = dataset_ops.Dataset.range(10).shard(5, 7)
52 self.evaluate(self.getNext(dataset)())
57 dataset = dataset_ops.Dataset.range(10).shard(5, -3)
58 self.evaluate(self.getNext(dataset)())
[all …]
/external/tensorflow/tensorflow/python/distribute/
Dinput_ops_test.py47 def _getNext(self, dataset): argument
49 iterator = iter(dataset)
52 iterator = dataset_ops.make_one_shot_iterator(dataset)
103 def _verifySimpleShardingOutput(self, dataset, record_fn): argument
104 next_element_fn = self._getNext(dataset)
114 dataset = readers.TFRecordDataset(self._createTFRecordFiles())
115 dataset = input_ops.auto_shard_dataset(
116 dataset, self._num_shards, self._shard_index)
118 self._verifySimpleShardingOutput(dataset, self._record)
122 dataset = dataset_ops.Dataset.from_tensor_slices(
[all …]
/external/tensorflow/tensorflow/python/keras/engine/
Dtraining_dataset_test.py69 dataset = dataset_ops.Dataset.from_tensor_slices((inputs, targets))
70 dataset = dataset.repeat(100)
71 dataset = dataset.batch(10)
75 dataset,
79 validation_data=dataset,
82 dataset,
86 validation_data=dataset,
104 dataset = dataset_ops.Dataset.from_tensor_slices((inputs, targets))
105 dataset = dataset.repeat() # Infinite dataset.
106 dataset = dataset.batch(10)
[all …]
/external/protobuf/benchmarks/cpp/
Dcpp_benchmark.cc54 Fixture(const BenchmarkDataset& dataset, const std::string& suffix) { in Fixture() argument
55 for (int i = 0; i < dataset.payload_size(); i++) { in Fixture()
56 payloads_.push_back(dataset.payload(i)); in Fixture()
61 dataset.message_name()); in Fixture()
64 std::cerr << "Couldn't find message named '" << dataset.message_name() in Fixture()
69 SetName((dataset.name() + suffix).c_str()); in Fixture()
97 ParseNewFixture(const BenchmarkDataset& dataset) in ParseNewFixture() argument
98 : Fixture(dataset, "_parse_new") {} in ParseNewFixture()
118 ParseNewArenaFixture(const BenchmarkDataset& dataset) in ParseNewArenaFixture() argument
119 : Fixture(dataset, "_parse_newarena") {} in ParseNewArenaFixture()
[all …]
/external/tensorflow/tensorflow/python/data/benchmarks/
Dmeta_benchmark.py45 dataset = self.setup_fast_dataset()
46 self.run_benchmark_with_only_cpp_iterations(dataset)
49 dataset = self.setup_fast_dataset()
50 self.run_benchmark_with_session_run(dataset)
53 dataset = self.setup_fast_dataset()
54 self.run_benchmark_with_session_run(dataset, make_callable=True)
58 dataset = self.setup_fast_dataset()
59 self.run_benchmark_in_eager(dataset)
62 dataset = self.setup_fast_dataset()
65 return dataset.apply(testing.sleep(1000))
[all …]
Dmap_benchmark.py39 dataset = dataset_ops.Dataset.range(10000)
41 dataset = dataset_ops.MapDataset(
42 dataset, fn, use_inter_op_parallelism=use_inter_op_parallelism)
44 dataset,
58 dataset = dataset_ops.Dataset.from_tensors(
60 dataset = dataset_ops.MapDataset(
61 dataset, fn, use_inter_op_parallelism=use_inter_op_parallelism)
63 dataset,
75 dataset = dataset_ops.Dataset.range(1000).repeat()
76 dataset = dataset.map(lambda x: x + 1, num_parallel_calls=32)
[all …]
/external/tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/
Dchoose_fastest_branch_dataset_serialization_test.py41 dataset = dataset_ops.Dataset.range(size)
43 def branch_0(dataset): argument
44 return dataset.map(lambda x: x).batch(10)
46 def branch_1(dataset): argument
47 return dataset.batch(10).map(lambda x: x)
50 dataset, [branch_0, branch_1],
60 dataset = dataset_ops.Dataset.range(10)
64 def branch_0(dataset): argument
65 return dataset.map(lambda x: x + const_64)
67 def branch_1(dataset): argument
[all …]

12345678910>>...27