[TF:XLA] Improve/refactor the handling of resource types/shapes.
authorPeter Hawkins <phawkins@google.com>
Fri, 2 Feb 2018 19:31:06 +0000 (11:31 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Fri, 2 Feb 2018 19:36:32 +0000 (11:36 -0800)
commit22116459b258d5753aa76410ab6f4d3cbc928a5a
treed2f906ab2dafa09b6d40028a951c68c4be409c85
parent224874002f93fec471e401488e23d97d4f36c4fc
[TF:XLA] Improve/refactor the handling of resource types/shapes.

Previously we used an xla::Shape to track the shape of a resource (Variable, TensorArray, Stack) shape. The xla::Shape described how the resource was represented to XLA, e.g., as a (buffer, size) pair for a Stack resource.

Instead, separate the TensorFlow abstract shape representation from the XLA shape representation and track it separately. This leads to simpler and more readable code.

PiperOrigin-RevId: 184310694
19 files changed:
tensorflow/compiler/jit/kernels/xla_launch_op.cc
tensorflow/compiler/jit/xla_compilation_cache.cc
tensorflow/compiler/tf2xla/graph_compiler.cc
tensorflow/compiler/tf2xla/kernels/stack_ops.cc
tensorflow/compiler/tf2xla/kernels/strided_slice_op.cc
tensorflow/compiler/tf2xla/kernels/tensor_array_ops.cc
tensorflow/compiler/tf2xla/kernels/training_ops.cc
tensorflow/compiler/tf2xla/kernels/variable_ops.cc
tensorflow/compiler/tf2xla/kernels/while_op.cc
tensorflow/compiler/tf2xla/tf2xla.cc
tensorflow/compiler/tf2xla/xla_compiler.cc
tensorflow/compiler/tf2xla/xla_compiler.h
tensorflow/compiler/tf2xla/xla_compiler_test.cc
tensorflow/compiler/tf2xla/xla_context.cc
tensorflow/compiler/tf2xla/xla_context.h
tensorflow/compiler/tf2xla/xla_op_kernel.cc
tensorflow/compiler/tf2xla/xla_op_kernel.h
tensorflow/compiler/tf2xla/xla_resource.cc
tensorflow/compiler/tf2xla/xla_resource.h