Skip to content

Commit

Permalink
Add ReluGrad instruction
Browse files Browse the repository at this point in the history
Summary:
This commit adds a ReluGrad instruction for use by backends that do not want to
lower this node to CmpLTE + Select + Splat.

Reviewed By: nickgg

Differential Revision: D19163048

fbshipit-source-id: 672adbed30bd63e125372d3f14b18c5f2e8c990a
  • Loading branch information
Meghan Lele authored and facebook-github-bot committed Dec 19, 2019
1 parent 41d3e30 commit 17b326f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/Backends/Interpreter/InterpreterNodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2602,6 +2602,10 @@ void BoundInterpreterFunction::fwdBatchMatMulInst(
DCHECK(!"Found BatchMatMulInst but BatchMatMul is lowered on Interpreter");
}

void BoundInterpreterFunction::fwdReluGradInst(const glow::ReluGradInst *I) {
DCHECK(!"Found ReluGradInst but ReluGrad is lowered on Interpreter");
}

//===----------------------------------------------------------------------===//
// FC
//===----------------------------------------------------------------------===//
Expand Down
3 changes: 2 additions & 1 deletion tools/ClassGen/InstrGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,8 @@ int main(int argc, char **argv) {
})
.dataParallel()
.autoVerify(VerifyKind::SameType, {"Dest", "Src"})
.autoIRGen();
.autoIRGen()
.addGradientInstr({"Dest"}, {"Dest", "Src"});

BB.newInstr("Sigmoid")
.addOperand("Dest", OperandKind::Out)
Expand Down

0 comments on commit 17b326f

Please sign in to comment.