Commit 9bdb7ec5 authored by Nick Desaulniers's avatar Nick Desaulniers Committed by TensorFlower Gardener
Browse files

[TF:XLA] remove re-initializations of Literals



It's an antipattern to have:

auto x = Literal::CreateFromShape(my_shape);
x->Populate();

as that results in initialization followed by reinitialization. Can be replaced
with:

auto x = MakeUnique<Literal>(my_shape);
x->Populate();

Suggested-by: default avatarKay Zhu <kayzhu@google.com>
PiperOrigin-RevId: 197007127
parent 295587d1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment