From briefly trying to debug this, the issue seems to be:
hcl.asarray eventually calls ndarray.py:array which has the following code:
def array(arr, dtype=None, ctx=cpu(0)):
...
if not isinstance(arr, (_np.ndarray, NDArray)):
arr = _np.array(arr)
if dtype is None:
dtype = arr.dtype
return empty(arr.shape, dtype, ctx).copyfrom(arr)
Since arr is just a python list in this case, it calls arr = np.array(arr). However, since this call doesn't have a numpy dtype specified, numpy will use "the most appropriate data type that fits the size of the data" .... which in this case is a float.
The copyfrom function then copies the array values that is now in floating point representation in memory.
W/A is to do something like: hcl.asarray (np.array (inp, dtype=np.ulonglong), dtype=hcl.UInt(64)).
Should fix hcl.asarray, especially since the dtype is specified. As is, it is basically silently passing garbage data.
Code:
Output:
From briefly trying to debug this, the issue seems to be:
W/A is to do something like: hcl.asarray (np.array (inp, dtype=np.ulonglong), dtype=hcl.UInt(64)).
Should fix hcl.asarray, especially since the dtype is specified. As is, it is basically silently passing garbage data.