Skip to content

Commit 430329e

Browse files
albanDfacebook-github-bot
authored andcommitted
Revert D26009829: Optimize relu on cpu using clamp_min
Test Plan: revert-hammer Differential Revision: D26009829 (pytorch@2054cd5) Original commit changeset: 7bb1583ffb3e fbshipit-source-id: 3e945b438fb8d83f721e400ae69be8848cab9720
1 parent 50c9c08 commit 430329e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

aten/src/ATen/native/Activation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ Tensor hardswish_backward(const Tensor& grad_output, const Tensor& self) {
162162
}
163163

164164
Tensor relu(const Tensor & self) {
165-
return at::clamp_min(self, 0);
165+
return at::threshold(self, 0, 0);
166166
}
167167

168168
Tensor & relu_(Tensor & self) {
169-
return at::clamp_min_(self, 0);
169+
return at::threshold_(self, 0, 0);
170170
}
171171

172172
Tensor selu(const Tensor & self) {

0 commit comments

Comments
 (0)