JuliaGPU/XLA.jl

Random array creation did not work

ViralBShah opened this issue · 1 comments

julia> f(x) = XLA.HloRng(Float32, (5,5), 1)(XRTArray(0f0),XRTArray(1f0))
f (generic function with 2 methods)

julia> @tpu_compile f(XRTArray(1));

julia> run(ans, XLA.gethandle!(sess, XRTArray(1)))
5×5 XRTArray{Float32,(5, 5),2}:
 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.0  0.0  0.0  0.0  0.0
 0.0  0.0  0.0  0.0  0.0

julia>
Keno commented

It looks like we need to set the seed for the hardware prng: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/compiler/xrt/xrt.proto#L96