aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/computation_layout.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-04-20 15:19:59 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-04-20 15:22:40 -0700
commit60a0e2f5261cf72da4e4d8e65b56b695d611b984 (patch)
treefa80d75b322e70f969ba4ae8e9bdfc49da6550ea /tensorflow/compiler/xla/service/computation_layout.cc
parentb133f8c70622e52f19631fd93d4b87ee21c52ac6 (diff)
Do not force default layout when there is no need to.
Allow the inner computations to negotiate a root and parameter layouts different from default. PiperOrigin-RevId: 193731341
Diffstat (limited to 'tensorflow/compiler/xla/service/computation_layout.cc')
-rw-r--r--tensorflow/compiler/xla/service/computation_layout.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/tensorflow/compiler/xla/service/computation_layout.cc b/tensorflow/compiler/xla/service/computation_layout.cc
index d2d4f14fce..cb61f3da39 100644
--- a/tensorflow/compiler/xla/service/computation_layout.cc
+++ b/tensorflow/compiler/xla/service/computation_layout.cc
@@ -23,12 +23,15 @@ limitations under the License.
namespace xla {
-ComputationLayout::ComputationLayout(const ProgramShape& program_shape)
+ComputationLayout::ComputationLayout(const ProgramShape& program_shape,
+ bool ignore_layouts)
: result_layout_(program_shape.result()) {
for (auto& shape : program_shape.parameters()) {
parameter_layouts_.emplace_back(shape);
}
- SetToDefaultLayout();
+ if (ignore_layouts) {
+ SetToDefaultLayout();
+ }
}
void ComputationLayout::SetToDefaultLayout() {