Closed zzzDavid closed 2 years ago
Some observations:
B's datatype is assigned by hcl.quantize
through algorithm.B
, and the extra type hint info attribute is assigned through tracing tensor uses from input to output. So, algorithm.B
and A.uses[0]
should refer to the same tensor in order to make type hint info correct.
Currently, these two tensor seems to be different:
This problem is caused by this line: https://github.com/chhzh123/heterocl/blob/30138f1eca6cdb81701a7ad3a70b7b2425d6c7cd/python/heterocl/mlir/tensor.py#L141
When hcl.compute
is called, it first builds a Tensor
instance, which then calls ComputeOp
with None
as the output
keyword argument. When ComputeOp
is initialized with output=None
, it then builds another Tensor
instance as output, so that we have two different Tensor
instances for a single stage.
Description
tests/mlir/test_api.py::test_resize()
Example
HeteroCL Program:
IR:
The output type hint should be
u
instead ofs
.