diff options
Diffstat (limited to 'tensorflow/compiler/xla/service/indexed_array_analysis.h')
-rw-r--r-- | tensorflow/compiler/xla/service/indexed_array_analysis.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tensorflow/compiler/xla/service/indexed_array_analysis.h b/tensorflow/compiler/xla/service/indexed_array_analysis.h index 9746d176cc..df9cbab915 100644 --- a/tensorflow/compiler/xla/service/indexed_array_analysis.h +++ b/tensorflow/compiler/xla/service/indexed_array_analysis.h @@ -347,21 +347,19 @@ class IndexedArrayAnalysis { } } - Literal* TakeOwnership(std::unique_ptr<Literal> literal) { + Literal* TakeOwnership(Literal literal) { owned_literals_.push_back(std::move(literal)); - return owned_literals_.back().get(); + return &owned_literals_.back(); } - StatusOr<Literal*> TakeOwnership( - StatusOr<std::unique_ptr<Literal>> literal_or_error) { - TF_ASSIGN_OR_RETURN(std::unique_ptr<Literal> literal, - std::move(literal_or_error)); + StatusOr<Literal*> TakeOwnership(StatusOr<Literal> literal_or_error) { + TF_ASSIGN_OR_RETURN(Literal literal, std::move(literal_or_error)); owned_literals_.push_back(std::move(literal)); - return owned_literals_.back().get(); + return &owned_literals_.back(); } std::vector<std::unique_ptr<Array>> owned_tensors_; - std::vector<std::unique_ptr<Literal>> owned_literals_; + std::vector<Literal> owned_literals_; tensorflow::gtl::FlatMap<const HloInstruction*, Array*> cache_; }; |