diff options
author | 2017-09-14 08:04:42 -0700 | |
---|---|---|
committer | 2017-09-14 08:08:57 -0700 | |
commit | 0550f50bfd1b02687d517928b5a7ce776e8892fc (patch) | |
tree | 56bd88af0b12c9b29d63ac712c3ac86f88603408 /tensorflow/compiler/xla/literal_util.h | |
parent | 6d7c72f19c157fdcb13a7086eff5e92bec9c2bc2 (diff) |
[XLA] Remove Literal::Swap and replace all uses with moves.
This stems from the dark ages when Literal was an unmovable proto. Swap was
supposed to be fast (it moves) but in the conversion to a standalone class Swap
wasn't implemented properly and became a 3-way copy instead of a 3-way move.
All of the users want move anyways, so just remove Swap and use moves on all
call sites.
If actual swapping is needed, std::swap will work just fine for Literal, and
the default implementation is as fast as 3 moves.
PiperOrigin-RevId: 168689138
Diffstat (limited to 'tensorflow/compiler/xla/literal_util.h')
-rw-r--r-- | tensorflow/compiler/xla/literal_util.h | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/tensorflow/compiler/xla/literal_util.h b/tensorflow/compiler/xla/literal_util.h index 6451345918..ccbc09af88 100644 --- a/tensorflow/compiler/xla/literal_util.h +++ b/tensorflow/compiler/xla/literal_util.h @@ -166,12 +166,6 @@ class Literal { const Shape& shape() const { return shape_; } Shape* mutable_shape() { return &shape_; } - void Swap(Literal* other) { - Literal temp = *this; - *this = *other; - *other = temp; - } - // Creates a new literal of a given rank. To minimize ambiguity (for users // and the compiler) these CreateR[0-2] methods should explicitly specify the // native type. For example: |