Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[testing] Use tuples for numpy indexing #14476

Merged
merged 1 commit into from
Apr 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions python/tvm/topi/testing/poolnd_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def get_slice(
kernel: Tuple[int],
strides: Tuple[int],
dilation: Tuple[int],
) -> List[slice]:
) -> Tuple[slice]:
"""
Programmatically create a slice object of the right dimensions for pad_np.

Expand All @@ -100,7 +100,7 @@ def get_slice(
# Add back batch and channel dimensions
slices = [slice(None), slice(None)] + slices

return slices
return tuple(slices)


def pad_tensor(
Expand Down Expand Up @@ -189,7 +189,7 @@ def poolnd_python(
dilation=dilation,
)

output_slice = [slice(None), slice(None)] + list(coordinate)
output_slice = (slice(None), slice(None)) + tuple(coordinate)
reduction_axis = tuple(range(2, len(np_data.shape)))
if pool_type == "avg":
count_non_padded = (
Expand Down