I’m calling Nx.from_binary(binary, :u8)
If the binary_size is above 2147483647 (which is 2^31 - 1) then it raises the below error:
iex(dev@dev)49> Nx.from_binary(binary_part(bin, 0, 2147483647), :u8)
#Nx.Tensor<
u8[2147483647]
EXLA.Backend<host:0, 0.4210033359.2202140741.62473>
[0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, ...]
>
iex(dev@dev)50> Nx.from_binary(binary_part(bin, 0, 2147483648), :u8)
** (RuntimeError) Unable to get dimensions.
(exla 0.7.2) lib/exla/shape.ex:89: EXLA.Shape.unwrap!/1
(exla 0.7.2) lib/exla/shape.ex:29: EXLA.Shape.make_shape/2
(exla 0.7.2) lib/exla/backend.ex:45: EXLA.Backend.from_binary/3
iex:50: (file)
Is this intended behavior or fundamental limitation? I don’t find it documented in EXLA or NX.