aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/hlo_query.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_query.cc')
-rw-r--r--tensorflow/compiler/xla/service/hlo_query.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_query.cc b/tensorflow/compiler/xla/service/hlo_query.cc
index d699737864..a153d73dbd 100644
--- a/tensorflow/compiler/xla/service/hlo_query.cc
+++ b/tensorflow/compiler/xla/service/hlo_query.cc
@@ -32,6 +32,16 @@ bool IsConstantR0F32(HloInstruction* instruction, float* out) {
return false;
}
+bool AllOperandsAreParametersOrConstants(const HloInstruction& instruction) {
+ for (const auto& operand : instruction.operands()) {
+ if (operand->opcode() != HloOpcode::kParameter &&
+ operand->opcode() != HloOpcode::kConstant) {
+ return false;
+ }
+ }
+ return true;
+}
+
bool AllOperandsAreParameters(const HloInstruction& instruction) {
for (const auto& operand : instruction.operands()) {
if (operand->opcode() != HloOpcode::kParameter) {