mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[2/N] Fix clang-tidy warnings in torch/csrc/autograd (#133295)
Follows #133180 Pull Request resolved: https://github.com/pytorch/pytorch/pull/133295 Approved by: https://github.com/Skylion007
This commit is contained in:
@ -3,8 +3,7 @@
|
||||
// TODO: we may be able to move some imports from input_metadata.h to here, but
|
||||
// it seems that function.h transitively depends on some of them.
|
||||
|
||||
namespace torch {
|
||||
namespace autograd {
|
||||
namespace torch::autograd {
|
||||
|
||||
namespace {
|
||||
|
||||
@ -158,7 +157,6 @@ std::stringstream InputMetadata::incompatible_shape_error_message(
|
||||
}
|
||||
|
||||
bool InputMetadata::is_cpp_nested_tensor() const {
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-init-variables)
|
||||
bool ret = std::holds_alternative<at::Tensor>(shape_);
|
||||
TORCH_INTERNAL_ASSERT(ret == (is_nested_ && !is_tensor_subclass_))
|
||||
return ret;
|
||||
@ -203,5 +201,4 @@ bool InputMetadata::maybe_expandable_to(const at::Tensor& grad) const {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace autograd
|
||||
} // namespace torch
|
||||
} // namespace torch::autograd
|
||||
|
Reference in New Issue
Block a user