aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/zero_sized_hlo_elimination.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/compiler/xla/service/zero_sized_hlo_elimination.cc')
-rw-r--r--tensorflow/compiler/xla/service/zero_sized_hlo_elimination.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/tensorflow/compiler/xla/service/zero_sized_hlo_elimination.cc b/tensorflow/compiler/xla/service/zero_sized_hlo_elimination.cc
index 44b0ec5cd4..83d696fe09 100644
--- a/tensorflow/compiler/xla/service/zero_sized_hlo_elimination.cc
+++ b/tensorflow/compiler/xla/service/zero_sized_hlo_elimination.cc
@@ -15,7 +15,7 @@ limitations under the License.
#include "tensorflow/compiler/xla/service/zero_sized_hlo_elimination.h"
-#include "tensorflow/compiler/xla/literal_util.h"
+#include "tensorflow/compiler/xla/literal.h"
#include "tensorflow/compiler/xla/service/hlo_computation.h"
#include "tensorflow/compiler/xla/service/hlo_instruction.h"
#include "tensorflow/compiler/xla/shape_util.h"
@@ -32,7 +32,8 @@ StatusOr<bool> ZeroSizedHloElimination::Run(HloModule* module) {
for (HloComputation* comp : module->MakeNonfusionComputations()) {
for (HloInstruction* instruction : comp->MakeInstructionPostOrder()) {
if (instruction->HasSideEffect() ||
- !ShapeUtil::IsArray(instruction->shape())) {
+ !ShapeUtil::IsArray(instruction->shape()) ||
+ instruction->opcode() == HloOpcode::kConstant) {
continue;
}
if (comp->IsRemovable(instruction) &&