I may be able to wrap NDarrays in relay.const, and stuff them into a List ADT. I’ll try ASAP
UPDATE: Tried converting numpy lists into a prelude List of relay.Constant, using the function below.
def convert_to_list_adt(py_lst, prelude):
adt_lst = prelude.nil()
for arr in reversed(py_lst):
adt_lst = prelude.cons(relay.const(arr), adt_lst)
return adt_lst
But I got Downcast from relay.Call to vm.ADT failed. error from VM RunLoop. The Call should correspond to prelude cons op. Since Call is a compile time stuff, it shouldn’t come up in VM runtime right? How can I evaluate Call and get List ADT (the result of cons)?