aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Justin Lebar <jlebar@google.com>2017-03-14 21:29:40 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-03-14 22:47:43 -0700
commit71e14e91e882422b3c010a7d20c6e78c28c918dc (patch)
tree2fae246e3644095f57bc9277e2d183941127f995
parent173d1b32ce54874e85400e2d5007b1c3380bdb14 (diff)
[XLA] Avoid calling malloc/free in TransposeLiteralInternal.
Change: 150155800
-rw-r--r--tensorflow/compiler/xla/literal_util.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/tensorflow/compiler/xla/literal_util.cc b/tensorflow/compiler/xla/literal_util.cc
index f48f0eb7a5..7091c324d1 100644
--- a/tensorflow/compiler/xla/literal_util.cc
+++ b/tensorflow/compiler/xla/literal_util.cc
@@ -279,8 +279,7 @@ void TransposeLiteralInternal(const Literal& original,
for (int64 i = 0; i < indices.size(); ++i) {
new_indices[i] = indices[permutation[i]];
}
- LiteralUtil::Set<T>(
- result, Permute(InversePermutation(permutation), indices), value);
+ LiteralUtil::Set<T>(result, new_indices, value);
});
}
} // namespace