MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / HandleClamp

Method HandleClamp

tensorflow/compiler/xla/service/algebraic_simplifier.cc:2199–2214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2197}
2198
2199Status AlgebraicSimplifierVisitor::HandleClamp(HloInstruction* clamp) {
2200 HloInstruction* clamp_lower_bound;
2201 HloInstruction* clamp_upper_bound;
2202 HloInstruction* to_clamp;
2203 CHECK(Match(clamp, m::Clamp(m::Op(&clamp_lower_bound), m::Op(&to_clamp),
2204 m::Op(&clamp_upper_bound))));
2205
2206 // clamp(a, clamp(a, x, b), b) -> clamp(a, x, b)
2207 if (Match(to_clamp, m::Clamp(m::Op().Is(clamp_lower_bound), m::Op(),
2208 m::Op().Is(clamp_upper_bound))) &&
2209 ReplaceInstructionIfSameShape(clamp, to_clamp)) {
2210 return Status::OK();
2211 }
2212
2213 return Status::OK();
2214}
2215
2216Status AlgebraicSimplifierVisitor::HandleMultiply(HloInstruction* multiply) {
2217 HloInstruction *lhs, *rhs;

Callers

nothing calls this directly

Calls 4

IsMethod · 0.80
MatchFunction · 0.70
OpFunction · 0.70
ClampFunction · 0.50

Tested by

no test coverage detected