In this PR, we fix the data types for the following cases.
# 1. Data type of a struct element
stype = hcl.Struct({"fa": hcl.Int(8), "fb": hcl.Fixed(13, 11), "fc": hcl.Float()})
D = hcl.compute(A.shape, lambda x: (x, x, x), dtype=stype)
print(D[0].fa.dtype) # => should be "int8"
# 2. Data type of a bit slice
# 2.1 If the length of the slice can be determined at compile time, we will show the updated data type
A = hcl.compute(..., dtype=hcl.Int(32))
print(A[0][0:2].dtype) # => should be "int2"
print(A[0][A[0]: A[0]+1].dtype) # => should be "int1"
# 2.2 If the length cannot be determined, we return the original data type
print(A[0][A[0] : A[3]].dtype) # => should be "int32"
In this PR, we fix the data types for the following cases.