MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / EQ>

Method EQ>

src/jit/impl/mlir/ir/each_mode.cpp:214–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212//! EQ: x == y ? 1 : 0
213template <>
214mlir::Value lower_mode<Mode::EQ>(
215 mlir::OpBuilder& builder, mlir::Location loc, ValueRange operands) {
216 ValueBuilderHelper helper(builder, loc);
217 return helper.select(
218 helper.eq(operands[0], operands[1]), helper.const_f32(1.f),
219 helper.const_f32(0.f));
220}
221
222//! FAST_TANH_GRAD: ((-48.f * x * x) / (3.f + x * x) + 27.f + x * x) / (3.f + x
223//! * x) * y

Callers

nothing calls this directly

Calls 3

const_f32Method · 0.80
selectMethod · 0.45
eqMethod · 0.45

Tested by

no test coverage detected