quic-sanirudh commented on code in PR #12082:
URL: https://github.com/apache/tvm/pull/12082#discussion_r923627047
##########
tests/python/contrib/test_hexagon/test_2d_physical_buffers.py:
##########
@@ -189,18 +196,19 @@ def schedule_args(
working_layout,
working_scope,
):
- InputTensor = te.placeholder(input_shape, dtype, name="Input")
- OutputTensor = te.compute(
- shape=InputTensor.shape,
- fcompute=lambda *indices: (2 * InputTensor[indices]).astype(dtype),
+ """Create and return the schedule and input args after applying layout
transform"""
+ input_tensor = te.placeholder(input_shape, dtype, name="Input")
+ output_tensor = te.compute(
+ shape=input_tensor.shape,
+ fcompute=lambda *indices: (2 *
input_tensor[indices]).astype(dtype),
name="Output",
)
- schedule = te.create_schedule(OutputTensor.op)
+ schedule = te.create_schedule(output_tensor.op)
- WriteCache = schedule.cache_write(OutputTensor, working_scope)
- ReadCache = schedule.cache_read(InputTensor, working_scope,
[WriteCache])
+ write_cache = schedule.cache_write(output_tensor, working_scope)
+ read_cache = schedule.cache_read(input_tensor, working_scope,
[write_cache])
- def apply_transform(tensor, layout):
+ def apply_transform(tensor, layout): # pylint:
disable=inconsistent-return-statements
Review Comment:
Thanks for catching this. I had meant to try out `return None` and had only
temporarily disabled it, but forgot to get back to it. I've changed the code to
`return None` now which works and which also forced me to get rid of the `elif`
statements to `if` because they follow returns.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]