Line data Source code
1 : #if !defined(TORCH_STABLE_ONLY) && !defined(TORCH_TARGET_VERSION)
2 : #pragma once
3 :
4 : // @generated by torchgen/gen.py from Function.h
5 :
6 : #include <ATen/Context.h>
7 : #include <ATen/DeviceGuard.h>
8 : #include <ATen/TensorUtils.h>
9 : #include <ATen/TracerMode.h>
10 : #include <ATen/core/Generator.h>
11 : #include <ATen/core/Reduction.h>
12 : #include <ATen/core/Tensor.h>
13 : #include <c10/core/Scalar.h>
14 : #include <c10/core/Storage.h>
15 : #include <c10/core/TensorOptions.h>
16 : #include <c10/util/Deprecated.h>
17 : #include <optional>
18 : #include <string_view>
19 :
20 :
21 :
22 : #include <ATen/ops/empty_ops.h>
23 :
24 : namespace at {
25 :
26 :
27 : // aten::empty.names(int[] size, *, Dimname[]? names, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, MemoryFormat? memory_format=None) -> Tensor
28 : inline at::Tensor empty(at::IntArrayRef size, ::std::optional<at::DimnameList> names, at::TensorOptions options={}, ::std::optional<at::MemoryFormat> memory_format=::std::nullopt) {
29 : return at::_ops::empty_names::call(size, names, c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt(), c10::impl::check_tensor_options_and_extract_memory_format(options, memory_format));
30 : }
31 : // aten::empty.names(int[] size, *, Dimname[]? names, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, MemoryFormat? memory_format=None) -> Tensor
32 : inline at::Tensor empty(at::IntArrayRef size, ::std::optional<at::DimnameList> names, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory, ::std::optional<at::MemoryFormat> memory_format) {
33 : return at::_ops::empty_names::call(size, names, dtype, layout, device, pin_memory, memory_format);
34 : }
35 :
36 : // aten::empty.memory_format(SymInt[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, MemoryFormat? memory_format=None) -> Tensor
37 34 : inline at::Tensor empty(at::IntArrayRef size, at::TensorOptions options={}, ::std::optional<at::MemoryFormat> memory_format=::std::nullopt) {
38 68 : return at::_ops::empty_memory_format::call(c10::fromIntArrayRefSlow(size), c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt(), c10::impl::check_tensor_options_and_extract_memory_format(options, memory_format));
39 : }
40 : namespace symint {
41 : template <typename T, typename = std::enable_if_t<std::is_same_v<T, int64_t>>>
42 : at::Tensor empty(at::IntArrayRef size, at::TensorOptions options={}, ::std::optional<at::MemoryFormat> memory_format=::std::nullopt) {
43 : return at::_ops::empty_memory_format::call(c10::fromIntArrayRefSlow(size), c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt(), c10::impl::check_tensor_options_and_extract_memory_format(options, memory_format));
44 : }
45 : }
46 :
47 : // aten::empty.memory_format(SymInt[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, MemoryFormat? memory_format=None) -> Tensor
48 : inline at::Tensor empty(at::IntArrayRef size, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory, ::std::optional<at::MemoryFormat> memory_format) {
49 : return at::_ops::empty_memory_format::call(c10::fromIntArrayRefSlow(size), dtype, layout, device, pin_memory, memory_format);
50 : }
51 : namespace symint {
52 : template <typename T, typename = std::enable_if_t<std::is_same_v<T, int64_t>>>
53 : at::Tensor empty(at::IntArrayRef size, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory, ::std::optional<at::MemoryFormat> memory_format) {
54 : return at::_ops::empty_memory_format::call(c10::fromIntArrayRefSlow(size), dtype, layout, device, pin_memory, memory_format);
55 : }
56 : }
57 :
58 : // aten::empty.memory_format(SymInt[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, MemoryFormat? memory_format=None) -> Tensor
59 : inline at::Tensor empty_symint(c10::SymIntArrayRef size, at::TensorOptions options={}, ::std::optional<at::MemoryFormat> memory_format=::std::nullopt) {
60 : return at::_ops::empty_memory_format::call(size, c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt(), c10::impl::check_tensor_options_and_extract_memory_format(options, memory_format));
61 : }
62 : namespace symint {
63 : template <typename T, typename = std::enable_if_t<std::is_same_v<T, c10::SymInt>>>
64 : at::Tensor empty(c10::SymIntArrayRef size, at::TensorOptions options={}, ::std::optional<at::MemoryFormat> memory_format=::std::nullopt) {
65 : return at::_ops::empty_memory_format::call(size, c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt(), c10::impl::check_tensor_options_and_extract_memory_format(options, memory_format));
66 : }
67 : }
68 :
69 : // aten::empty.memory_format(SymInt[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, MemoryFormat? memory_format=None) -> Tensor
70 : inline at::Tensor empty_symint(c10::SymIntArrayRef size, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory, ::std::optional<at::MemoryFormat> memory_format) {
71 : return at::_ops::empty_memory_format::call(size, dtype, layout, device, pin_memory, memory_format);
72 : }
73 : namespace symint {
74 : template <typename T, typename = std::enable_if_t<std::is_same_v<T, c10::SymInt>>>
75 : at::Tensor empty(c10::SymIntArrayRef size, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory, ::std::optional<at::MemoryFormat> memory_format) {
76 : return at::_ops::empty_memory_format::call(size, dtype, layout, device, pin_memory, memory_format);
77 : }
78 : }
79 :
80 : // aten::empty.out(SymInt[] size, *, MemoryFormat? memory_format=None, Tensor(a!) out) -> Tensor(a!)
81 : inline at::Tensor & empty_out(at::Tensor & out, at::IntArrayRef size, ::std::optional<at::MemoryFormat> memory_format=::std::nullopt) {
82 : return at::_ops::empty_out::call(c10::fromIntArrayRefSlow(size), memory_format, out);
83 : }
84 : namespace symint {
85 : template <typename T, typename = std::enable_if_t<std::is_same_v<T, int64_t>>>
86 : at::Tensor & empty_out(at::Tensor & out, at::IntArrayRef size, ::std::optional<at::MemoryFormat> memory_format=::std::nullopt) {
87 : return at::_ops::empty_out::call(c10::fromIntArrayRefSlow(size), memory_format, out);
88 : }
89 : }
90 :
91 : // aten::empty.out(SymInt[] size, *, MemoryFormat? memory_format=None, Tensor(a!) out) -> Tensor(a!)
92 : inline at::Tensor & empty_outf(at::IntArrayRef size, ::std::optional<at::MemoryFormat> memory_format, at::Tensor & out) {
93 : return at::_ops::empty_out::call(c10::fromIntArrayRefSlow(size), memory_format, out);
94 : }
95 : namespace symint {
96 : template <typename T, typename = std::enable_if_t<std::is_same_v<T, int64_t>>>
97 : at::Tensor & empty_outf(at::IntArrayRef size, ::std::optional<at::MemoryFormat> memory_format, at::Tensor & out) {
98 : return at::_ops::empty_out::call(c10::fromIntArrayRefSlow(size), memory_format, out);
99 : }
100 : }
101 :
102 : // aten::empty.out(SymInt[] size, *, MemoryFormat? memory_format=None, Tensor(a!) out) -> Tensor(a!)
103 : inline at::Tensor & empty_symint_out(at::Tensor & out, c10::SymIntArrayRef size, ::std::optional<at::MemoryFormat> memory_format=::std::nullopt) {
104 : return at::_ops::empty_out::call(size, memory_format, out);
105 : }
106 : namespace symint {
107 : template <typename T, typename = std::enable_if_t<std::is_same_v<T, c10::SymInt>>>
108 : at::Tensor & empty_out(at::Tensor & out, c10::SymIntArrayRef size, ::std::optional<at::MemoryFormat> memory_format=::std::nullopt) {
109 : return at::_ops::empty_out::call(size, memory_format, out);
110 : }
111 : }
112 :
113 : // aten::empty.out(SymInt[] size, *, MemoryFormat? memory_format=None, Tensor(a!) out) -> Tensor(a!)
114 : inline at::Tensor & empty_symint_outf(c10::SymIntArrayRef size, ::std::optional<at::MemoryFormat> memory_format, at::Tensor & out) {
115 : return at::_ops::empty_out::call(size, memory_format, out);
116 : }
117 : namespace symint {
118 : template <typename T, typename = std::enable_if_t<std::is_same_v<T, c10::SymInt>>>
119 : at::Tensor & empty_outf(c10::SymIntArrayRef size, ::std::optional<at::MemoryFormat> memory_format, at::Tensor & out) {
120 : return at::_ops::empty_out::call(size, memory_format, out);
121 : }
122 : }
123 :
124 : // aten::empty.names_out(int[] size, *, Dimname[]? names, MemoryFormat? memory_format=None, Tensor(a!) out) -> Tensor(a!)
125 : inline at::Tensor & empty_out(at::Tensor & out, at::IntArrayRef size, ::std::optional<at::DimnameList> names, ::std::optional<at::MemoryFormat> memory_format=::std::nullopt) {
126 : return at::_ops::empty_names_out::call(size, names, memory_format, out);
127 : }
128 : // aten::empty.names_out(int[] size, *, Dimname[]? names, MemoryFormat? memory_format=None, Tensor(a!) out) -> Tensor(a!)
129 : inline at::Tensor & empty_outf(at::IntArrayRef size, ::std::optional<at::DimnameList> names, ::std::optional<at::MemoryFormat> memory_format, at::Tensor & out) {
130 : return at::_ops::empty_names_out::call(size, names, memory_format, out);
131 : }
132 :
133 : }
134 :
135 : #else
136 : #error "This file should not be included when either TORCH_STABLE_ONLY or TORCH_TARGET_VERSION is defined."
137 : #endif // !defined(TORCH_STABLE_ONLY) && !defined(TORCH_TARGET_VERSION)
|