Commit dea1afbf authored by Hong Xu's avatar Hong Xu Committed by Francisco Massa
Browse files

Use Tensor.clamp_() instead of torch::clamp_(). (#1107)

In-place operators should only have method variant. Update here in
preparation of future PyTorch change. For example see
https://github.com/pytorch/pytorch/issues/22707
parent 6693b2c6
...@@ -15,7 +15,7 @@ inline torch::Tensor& relu_(torch::Tensor x) { ...@@ -15,7 +15,7 @@ inline torch::Tensor& relu_(torch::Tensor x) {
} }
inline torch::Tensor relu6_(torch::Tensor x) { inline torch::Tensor relu6_(torch::Tensor x) {
return torch::clamp_(x, 0, 6); return x.clamp_(0, 6);
} }
inline torch::Tensor adaptive_avg_pool2d( inline torch::Tensor adaptive_avg_pool2d(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment