Files
pytorch/torch/csrc/Generator.h
Nikita Shulga 6a39613f35 [BE] Make torch/csrc/jit/tensorexpr/ clang-tidy clean (#55628)
Summary:
Mostly auto-generated changes using
```
 python3 tools/clang_tidy.py -c build -x torch/csrc/jit/tensorexpr/eval.cpp -s
```
With following common patterns manually fixed
- Use ` = default` instead of `{}`
- deleted methods should be public
- Use pass-by-value + std::move instead of pass-by-reference+copy

Pull Request resolved: https://github.com/pytorch/pytorch/pull/55628

Reviewed By: walterddr

Differential Revision: D27655378

Pulled By: malfet

fbshipit-source-id: 92be87a08113435d820711103ea9b0364182c71a
2021-04-08 19:44:14 -07:00

32 lines
1004 B
C

#pragma once
#include <torch/csrc/python_headers.h>
#include <ATen/ATen.h>
#include <torch/csrc/THP_export.h>
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)
struct THPGenerator {
PyObject_HEAD
at::Generator cdata;
};
// Creates a new Python object wrapping the default at::Generator. The reference is
// borrowed. The caller should ensure that the at::Generator object lifetime
// last at least as long as the Python wrapper.
THP_API PyObject * THPGenerator_initDefaultGenerator(at::Generator cdata);
#define THPGenerator_Check(obj) \
PyObject_IsInstance(obj, THPGeneratorClass)
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
THP_API PyObject *THPGeneratorClass;
bool THPGenerator_init(PyObject *module);
THP_API PyObject * THPGenerator_Wrap(at::Generator gen);
// Creates a new Python object for a Generator. The Generator must not already
// have a PyObject* associated with it.
PyObject* THPGenerator_NewWithVar(PyTypeObject* type, at::Generator gen);