def run_tf_dataset_no_copy(max_shape, dtype, dataset_dev, es_dev, no_copy):
    run_tf_dataset_graph(dataset_dev,
                         get_pipeline_desc=external_source_tester(
                             max_shape, dtype,
                             RandomSampleIterator(max_shape, dtype(0)), es_dev,
                             no_copy),
                         to_dataset=external_source_converter_with_callback(
                             RandomSampleIterator, max_shape, dtype))
def run_tf_dataset_with_constant_input(dev, shape, value, dtype, batch):
    tensor = np.full(shape, value, dtype)
    run_tf_dataset_graph(dev,
                         get_pipeline_desc=external_source_tester(
                             shape,
                             dtype,
                             FixedSampleIterator(tensor),
                             batch=batch),
                         to_dataset=external_source_converter_with_fixed_value(
                             shape, dtype, tensor, batch))
def run_tf_dataset_with_stop_iter(dev, max_shape, dtype, stop_samples):
    run_tf_dataset_graph(dev,
                         to_stop_iter=True,
                         get_pipeline_desc=external_source_tester(
                             max_shape, dtype,
                             RandomSampleIterator(max_shape,
                                                  dtype(0),
                                                  start=0,
                                                  stop=stop_samples)),
                         to_dataset=external_source_converter_with_callback(
                             RandomSampleIterator, max_shape, dtype, 0,
                             stop_samples))
def run_tf_dataset_with_random_input(dev, max_shape, dtype, batch):
    min_shape = get_min_shape_helper(batch, max_shape)
    iterator = RandomSampleIterator(max_shape, dtype(0), min_shape=min_shape)
    run_tf_dataset_graph(dev,
                         get_pipeline_desc=external_source_tester(max_shape,
                                                                  dtype,
                                                                  iterator,
                                                                  batch=batch),
                         to_dataset=external_source_converter_with_callback(
                             RandomSampleIterator,
                             max_shape,
                             dtype,
                             0,
                             1e10,
                             min_shape,
                             batch=batch))
def test_tf_dataset_cpu():
    run_tf_dataset_graph('cpu')
def test_tf_dataset_gpu():
    run_tf_dataset_graph('gpu')
def _test_tf_dataset_other_gpu():
    run_tf_dataset_graph('gpu', 1)
def run_tf_with_dali_external_source(dev, es_args, ed_dev, dtype, *_):
    run_tf_dataset_graph(dev,
                         get_pipeline_desc=get_external_source_pipe(
                             es_args, dtype, ed_dev),
                         to_dataset=external_source_to_tf_dataset,
                         to_stop_iter=True)
def run_tf_dataset_multi_input(dev, start_values, input_names, batches):
    run_tf_dataset_graph(dev,
                         get_pipeline_desc=external_source_tester_multiple(
                             start_values, input_names, batches),
                         to_dataset=external_source_converter_multiple(
                             start_values, input_names, batches))