Skip to content

Commit

Permalink
Pylint fix
Browse files Browse the repository at this point in the history
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
  • Loading branch information
yongtang committed Jan 11, 2020
1 parent 0e13e48 commit 9cadfdf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tensorflow_io/core/python/experimental/numpy_dataset_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ def p(entry):
except ValueError:
pass
if indices is not None:
values = [e for e in indices]
values = list(indices)
values.sort()
if not all([k == v for k, v in enumerate(values)]):
indices = None

# if indices is continuously, then construct a tuple, otherwise a dict.
if indices is not None:
entries = dict(zip(indices, entries))
Expand All @@ -74,7 +74,7 @@ def p(entry):
return 0, filename, entry.name, entry.shape, entry.dtype

flatten = tf.nest.flatten(entries)
assert all([entry.shape[0]==flatten[0].shape[0] for entry in flatten])
assert all([entry.shape[0] == flatten[0].shape[0] for entry in flatten])

params = [p(entry) for entry in flatten]

Expand Down
6 changes: 3 additions & 3 deletions tests/test_io_dataset_eager.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ def fixture_numpy():
data = [[i, i+1, i+2] for i in range(0, 5000)]

args = np.asarray(data)
func = lambda e: tfio.experimental.IODataset.from_numpy(e)
func = tfio.experimental.IODataset.from_numpy
expected = data

return args, func, expected
Expand All @@ -450,7 +450,7 @@ def fixture_numpy_structure():
d2 = [[i+2, i+1, i] for i in range(0, 5000)]

args = (np.asarray(d1), np.asarray(d2))
func = lambda e: tfio.experimental.IODataset.from_numpy(e)
func = tfio.experimental.IODataset.from_numpy
expected = list(zip(d1, d2))

return args, func, expected
Expand All @@ -472,7 +472,7 @@ def fin():
request.addfinalizer(fin)

args = filename
func = lambda e: tfio.experimental.IODataset.from_numpy(e)
func = tfio.experimental.IODataset.from_numpy
expected = list(zip(d1, d2))

return args, func, expected
Expand Down

0 comments on commit 9cadfdf

Please sign in to comment.