mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Summary: Update the API to access grad in cpp to avoid unexpected thread safety issues. In particular, with the current API, a check like `t.grad().defined()` is not thread safe. - This introduces `t.mutable_grad()` that should be used when getting a mutable version of the saved gradient. This function is **not** thread safe. - The `Tensor& grad()` API is now removed. We could not do a deprecation cycle as most of our call side use non-const Tensors that use the non-const overload. This would lead to most calls hitting the warning. This would be too verbose for all the users. Pull Request resolved: https://github.com/pytorch/pytorch/pull/40887 Reviewed By: ezyang Differential Revision: D22343932 Pulled By: albanD fbshipit-source-id: d5eb909bb743bc20caaf2098196e18ca4110c5d2 |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| model.py | ||
| op.cpp | ||
| op.h | ||
| test_custom_classes.py | ||
| test_custom_ops.cpp | ||
| test_custom_ops.py | ||