Users only need to specify the inputs once when first create a scheme or a schedule. Users do not need to specify the inputs again when lowering or building the function. The returned tensors do not need to be specified in the inputs list.
Users can now return tensors within an algorithm. The returned tensors will be treated as inputs to the final built function.
Users can now specify the default data type via the init API.
We show an example here.
# speficy the default data type for all tensors
hcl.init(hcl.Float())
A = hcl.placeholder(...)
def foo(A):
B = hcl.compute(A.shape, lambda x: A[x] + 1)
C = hcl.compute(A.shape, lambda x: A[x] + 2)
return B, C
# only need to specify the inputs here
# note that the inputs list does not include B and C
# it is also not possible for users to include B and C, which are inside a function
scheme = hcl.create_scheme([A], foo)
# apply quantization schemes
schedule = hcl.create_schedule_from_scheme(scheme)
# apply compute cutomization primitives
print hcl.lower(schedule) # no need to specify inputs list here
f = hcl.build(schedule) # same as above
_A = hcl.asarray(...)
_B = hcl.asarray(...)
_C = hcl.asarray(...)
f(_A, _B, _C) # the generated function has 3 arguments
Edit the introduction page
Update the online documentation with only pages that are useful to the users
make_*
tocreate_*
init
API.We show an example here.