TensorFlow.jl icon indicating copy to clipboard operation
TensorFlow.jl copied to clipboard

`zeros` creates constant locally

Open Keno opened this issue 7 years ago • 2 comments

The TF.jl implementation of zeros creates an array of zeros locally and then puts it into the graph. This is problematic if you're using a small client to drive a large distributed cluster (e.g. a TPU), both because the client can run out of memory and because you run into max message size limits.

Keno avatar Dec 14 '18 21:12 Keno

FWIW, fill(TensorFlow.constant(0f0), dims...) seems to work fairly well as an implementation here.

Keno avatar Dec 17 '18 21:12 Keno

Wanna just submit a PR to do that?

malmaud avatar Dec 19 '18 16:12 malmaud