Concat namespaces and other fixes in torch/csrc/utils (#127833)

It contains formatting and other minor fixes.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/127833
Approved by: https://github.com/ezyang
This commit is contained in:
cyy
2024-06-04 15:12:45 +00:00
committed by PyTorch MergeBot
parent 91461601b6
commit f8c6d43524
32 changed files with 67 additions and 129 deletions

View File

@ -77,8 +77,6 @@
#include <c10/core/DispatchKeySet.h>
#include <array>
#include <cstddef>
#include <memory>
#include <sstream>
#include <string>
#include <vector>
@ -224,6 +222,7 @@ struct PythonArgs {
int idx;
bool traceable;
// NOLINTNEXTLINE(cppcoreguidelines-avoid-const-or-ref-data-members)
const FunctionSignature& signature;
PyObject** args;
std::vector<PyObject*> overloaded_args; // NOTE: borrowed references
@ -504,7 +503,7 @@ inline std::vector<int64_t> PythonArgs::intlist(int i) {
return intlistWithDefault(i, signature.params[i].default_intlist);
}
inline PyObject* toPyObject(c10::SymInt symint) {
inline PyObject* toPyObject(const c10::SymInt& symint) {
if (symint.is_symbolic()) {
auto r = py::cast(symint).release().ptr();
TORCH_INTERNAL_ASSERT(r);