aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/literal_util.h
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-04-30 15:41:28 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-04-30 15:44:10 -0700
commit286d61b246280b3a8dea39ac2f7d48b7cdbd48dc (patch)
tree30892fee0b7141d446da14b35a88c407dc9e253d /tensorflow/compiler/xla/literal_util.h
parent9c961e80a6be0136fc43821f1ad01ea00f83acb3 (diff)
Do not allocate memory for literal as it will be allocated later.
PiperOrigin-RevId: 194857422
Diffstat (limited to 'tensorflow/compiler/xla/literal_util.h')
-rw-r--r--tensorflow/compiler/xla/literal_util.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/tensorflow/compiler/xla/literal_util.h b/tensorflow/compiler/xla/literal_util.h
index 8aa19222dc..956ff7d21c 100644
--- a/tensorflow/compiler/xla/literal_util.h
+++ b/tensorflow/compiler/xla/literal_util.h
@@ -74,6 +74,10 @@ class Literal {
Literal(const Literal& other) = delete;
Literal& operator=(const Literal& other) = delete;
Literal(Literal&& other);
+ // 'allocate_arrays' indicates whether to allocate memory for the arrays in
+ // the shape. If false, buffer pointers inside of the Literal::Pieces are set
+ // to nullptr.
+ Literal(const Shape& shape, bool allocate_arrays);
Literal& operator=(Literal&& other);
// Literals are equal if they have compatible shapes and the same data
@@ -659,11 +663,6 @@ class Literal {
int64 sparse_element_count() const;
protected:
- // 'allocate_arrays' indicates whether to allocate memory for the arrays in
- // the shape. If false, buffer pointers inside of the Literal::Pieces are set
- // to nullptr.
- Literal(const Shape& shape, bool allocate_arrays);
-
// Internal template helper for the Literal::CopySliceFrom(), matching its
// arguments one by one.
template <typename NativeT>