diff options
author | 2018-06-07 17:19:25 -0700 | |
---|---|---|
committer | 2018-06-07 17:23:31 -0700 | |
commit | 138e790ab9cb778430168d2b5f6abac1501aa2d8 (patch) | |
tree | 2d79d5a45010e4faec8155d0cb7f14856d794056 /tensorflow/compiler/xla/service/hlo_cost_analysis.cc | |
parent | 3bb7a913be6ba47df6fb1796dd8ce639cdbf1608 (diff) |
[XLA] Handle kSlice correctly in HloCostAnalysis
Slice doesn't read the entire input. It only reads enough to make the output.
PiperOrigin-RevId: 199722987
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_cost_analysis.cc')
-rw-r--r-- | tensorflow/compiler/xla/service/hlo_cost_analysis.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_cost_analysis.cc b/tensorflow/compiler/xla/service/hlo_cost_analysis.cc index 94c9c7eabc..b9d30ee802 100644 --- a/tensorflow/compiler/xla/service/hlo_cost_analysis.cc +++ b/tensorflow/compiler/xla/service/hlo_cost_analysis.cc @@ -172,7 +172,8 @@ Status HloCostAnalysis::HandleReverse(const HloInstruction*) { return Status::OK(); } -Status HloCostAnalysis::HandleSlice(const HloInstruction*) { +Status HloCostAnalysis::HandleSlice(const HloInstruction* slice) { + current_properties_[kBytesAccessedKey] = shape_size_(slice->shape()) * 2; return Status::OK(); } |