diff options
author | Peter Hawkins <phawkins@google.com> | 2018-09-26 14:38:52 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-09-26 14:47:04 -0700 |
commit | 83df298d2ed014d263570c7283322c982be556cc (patch) | |
tree | 96617614df168835d30158ee6040f8be09b40a07 /tensorflow | |
parent | a1801ecdbb75b4583d757204611afd9af28b4a49 (diff) |
[XLA] Remove use of DeconstructTuple from MakeFakeArgumentsOrDie.
DeconstructTuple doesn't support nested tuples yet, so MakeFakeArgumentsOrDie failed if any of the arguments were tuple-shaped. But we don't really need it here anyway, just build the arguments one-by-one.
PiperOrigin-RevId: 214671374
Diffstat (limited to 'tensorflow')
-rw-r--r-- | tensorflow/compiler/xla/client/lib/testing.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tensorflow/compiler/xla/client/lib/testing.cc b/tensorflow/compiler/xla/client/lib/testing.cc index 25cc37edc4..ff0ec76a7f 100644 --- a/tensorflow/compiler/xla/client/lib/testing.cc +++ b/tensorflow/compiler/xla/client/lib/testing.cc @@ -97,13 +97,11 @@ std::vector<std::unique_ptr<GlobalData>> MakeFakeArgumentsOrDie( << "Computation should have progran shape."; auto program_shape = computation.proto().program_shape(); - // Create and run a program which produces a tuple with one element per - // parameter, then return the tuple's constituent buffers. - std::vector<Shape> param_shapes(program_shape.parameters().begin(), - program_shape.parameters().end()); - auto fake_input_tuple = - MakeFakeDataOrDie(ShapeUtil::MakeTupleShape(param_shapes), client); - return client->DeconstructTuple(*fake_input_tuple).ValueOrDie(); + std::vector<std::unique_ptr<GlobalData>> results; + for (const Shape& shape : program_shape.parameters()) { + results.push_back(MakeFakeDataOrDie(shape, client)); + } + return results; } } // namespace xla |