Skip to content

Commit

Permalink
Exposes num_parallel_reads and num_parallel_calls (tensorflow#1232)
Browse files Browse the repository at this point in the history
* Exposes num_parallel_reads and num_parallel_calls

-Exposes `num_parallel_reads` and `num_parallel_calls` in AvroRecordDataset and `make_avro_record_dataset`
-Adds parameter constraints
-Fixes lint issues

* Exposes num_parallel_reads and num_parallel_calls

-Exposes `num_parallel_reads` and `num_parallel_calls` in AvroRecordDataset and `make_avro_record_dataset`
-Adds parameter constraints
-Fixes lint issues

* Exposes num_parallel_reads and num_parallel_calls

-Exposes `num_parallel_reads` and `num_parallel_calls` in AvroRecordDataset and `make_avro_record_dataset`
-Adds parameter constraints
-Fixes lint issues

* Fixes Lint Issues

* Removes Optional typing for method parameter

-

* Adds test method for _require() function

-This update adds a test to check if ValueErrors
are raised when given an invalid input for num_parallel_calls

* Uncomments skip for macOS pytests

* Fixes Lint issues

Co-authored-by: Abin Shahab <[email protected]>
  • Loading branch information
i-ony and ashahab committed Mar 15, 2021
1 parent 73d8155 commit 05ea36a
Showing 1 changed file with 0 additions and 49 deletions.
49 changes: 0 additions & 49 deletions tensorflow_io/core/python/experimental/avro_record_dataset_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,7 @@

def _require(condition: bool, err_msg: str = None) -> None:
"""Checks if the specified condition is true else raises exception
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 5203f5d9... Exposes num_parallel_reads and num_parallel_calls
=======
>>>>>>> bba69e31... Exposes num_parallel_reads and num_parallel_calls (#1232)
Args:
condition: The condition to test
err_msg: If specified, it's the error message to use if condition is not true.
Expand All @@ -44,23 +35,6 @@ def _require(condition: bool, err_msg: str = None) -> None:
Returns:
None
"""
<<<<<<< HEAD
<<<<<<< HEAD

=======
:param condition: The condition to test

:param err_msg: If specified, it's the error message to use if condition is not true.

:raises ValueError: Raised when the condition is false

:return: None.
"""
>>>>>>> 21bc6c7c... Exposes num_parallel_reads and num_parallel_calls
=======
>>>>>>> 5203f5d9... Exposes num_parallel_reads and num_parallel_calls
=======
>>>>>>> bba69e31... Exposes num_parallel_reads and num_parallel_calls (#1232)
if not condition:
raise ValueError(err_msg)

Expand Down Expand Up @@ -223,13 +197,6 @@ def __init__(
block_length=1,
):
"""Creates a `AvroRecordDataset` to read one or more AvroRecord files.
<<<<<<< HEAD
<<<<<<< HEAD

=======
>>>>>>> 5203f5d9... Exposes num_parallel_reads and num_parallel_calls
=======
>>>>>>> bba69e31... Exposes num_parallel_reads and num_parallel_calls (#1232)
Args:
filenames: A `tf.string` tensor or `tf.data.Dataset` containing one or
more filenames.
Expand All @@ -252,25 +219,9 @@ def __init__(
the degree of parallelism in the underlying Dataset.interleave call.
reader_schema: (Optional.) A `tf.string` scalar representing the reader
schema or None.
<<<<<<< HEAD
<<<<<<< HEAD
deterministic: (Optional.) A boolean controlling whether determinism should be traded for performance by
allowing elements to be produced out of order. Defaults to `True`
block_length: Sets the number of output on the output tensor. Defaults to 1
=======
<<<<<<< HEAD
>>>>>>> 21bc6c7c... Exposes num_parallel_reads and num_parallel_calls

=======
deterministic: (Optional.) A boolean controlling whether determinism should be traded for performance by
allowing elements to be produced out of order. Defaults to `True`
block_length: Sets the number of output on the output tensor. Defaults to 1
>>>>>>> d41d946... Added parameter constraints
=======
deterministic: (Optional.) A boolean controlling whether determinism should be traded for performance by
allowing elements to be produced out of order. Defaults to `True`
block_length: Sets the number of output on the output tensor. Defaults to 1
>>>>>>> bba69e31... Exposes num_parallel_reads and num_parallel_calls (#1232)
Raises:
TypeError: If any argument does not have the expected type.
ValueError: If any argument does not have the expected shape.
Expand Down

0 comments on commit 05ea36a

Please sign in to comment.