@@ -17,8 +17,8 @@ inline bool has_names(TensorList tensors) {
17
17
18
18
// Converts dim to an positional index. Errors if `dim` cannot be used to
19
19
// refer to any dimension of tensor.
20
- CAFFE2_API int64_t dimname_to_position (const Tensor& tensor, Dimname dim);
21
- CAFFE2_API std::vector<int64_t > dimnames_to_positions (const Tensor& tensor, DimnameList dims);
20
+ TORCH_API int64_t dimname_to_position (const Tensor& tensor, Dimname dim);
21
+ TORCH_API std::vector<int64_t > dimnames_to_positions (const Tensor& tensor, DimnameList dims);
22
22
23
23
// Unifies two DimnameList to produce a third. This is useful for implementing
24
24
// the named inference rule for binary broadcasting operations like add.
@@ -28,7 +28,7 @@ CAFFE2_API std::vector<int64_t> dimnames_to_positions(const Tensor& tensor, Dimn
28
28
// 2) Check misaligned: If a name `n` is in `names`, then it must appear at
29
29
// the same index from the right in other.
30
30
// 3) The output names are obtained by unifying the names individually from the right.
31
- CAFFE2_API std::vector<Dimname>
31
+ TORCH_API std::vector<Dimname>
32
32
unify_from_right (DimnameList names, DimnameList other, const char * action = " broadcast" );
33
33
34
34
[[noreturn]] inline void reportNYIDimnameOverload (const char * op_name) {
@@ -75,50 +75,50 @@ namespace namedinference {
75
75
// `names` can be empty; see [NOTE] Writing name inference rules
76
76
// If `names` is not empty, `names.size()` should equal `result.dim()`.
77
77
// When in doubt, use this overload instead of the others.
78
- CAFFE2_API Tensor& propagate_names_if_nonempty (
78
+ TORCH_API Tensor& propagate_names_if_nonempty (
79
79
Tensor& result,
80
80
DimnameList maybe_names,
81
81
bool validate_names = false );
82
82
83
83
// Propagates `names` to `result`. Only use this if we are certain that there are
84
84
// names to propagate (that names is not empty).
85
- CAFFE2_API Tensor& propagate_names (
85
+ TORCH_API Tensor& propagate_names (
86
86
Tensor& result,
87
87
DimnameList names,
88
88
bool validate_names = false );
89
89
90
90
// Propagates all names from src to result.
91
- CAFFE2_API void propagate_names (Tensor& result, const Tensor& src);
91
+ TORCH_API void propagate_names (Tensor& result, const Tensor& src);
92
92
93
93
// Propagates all names except for those at the excluded_idxs.
94
- CAFFE2_API void propagate_names_except (Tensor& result, const Tensor& src, IntArrayRef excluded_idxs);
94
+ TORCH_API void propagate_names_except (Tensor& result, const Tensor& src, IntArrayRef excluded_idxs);
95
95
96
96
// Used for reduction ops that have a `keepdim` arg.
97
- CAFFE2_API void propagate_names_for_reduction (Tensor& result, const Tensor& src, IntArrayRef excluded_idxs, bool keepdim);
97
+ TORCH_API void propagate_names_for_reduction (Tensor& result, const Tensor& src, IntArrayRef excluded_idxs, bool keepdim);
98
98
99
- CAFFE2_API void propagate_names_for_expand (Tensor& result, const Tensor& self);
99
+ TORCH_API void propagate_names_for_expand (Tensor& result, const Tensor& self);
100
100
101
- CAFFE2_API std::vector<Dimname> compute_cat_outnames (TensorList tensors);
101
+ TORCH_API std::vector<Dimname> compute_cat_outnames (TensorList tensors);
102
102
103
- CAFFE2_API std::vector<Dimname> compute_broadcast_outnames (
103
+ TORCH_API std::vector<Dimname> compute_broadcast_outnames (
104
104
const Tensor& self,
105
105
const Tensor& other);
106
106
107
- CAFFE2_API std::vector<Dimname> broadcast_to_outnames (
107
+ TORCH_API std::vector<Dimname> broadcast_to_outnames (
108
108
const Tensor& tensor,
109
109
const Tensor& reference_tensor,
110
110
const char * op_name);
111
111
112
- CAFFE2_API std::vector<Dimname> compute_matmul_outnames (const Tensor& self, const Tensor& other);
112
+ TORCH_API std::vector<Dimname> compute_matmul_outnames (const Tensor& self, const Tensor& other);
113
113
114
- CAFFE2_API std::vector<Dimname> compute_cdist_outnames (const Tensor& self, const Tensor& other);
114
+ TORCH_API std::vector<Dimname> compute_cdist_outnames (const Tensor& self, const Tensor& other);
115
115
116
- CAFFE2_API std::vector<Dimname> compute_bmm_outnames (
116
+ TORCH_API std::vector<Dimname> compute_bmm_outnames (
117
117
Tensor& result,
118
118
const Tensor& self,
119
119
const Tensor& other);
120
120
121
- CAFFE2_API std::vector<Dimname> compute_squeeze_outnames (const Tensor& tensor);
121
+ TORCH_API std::vector<Dimname> compute_squeeze_outnames (const Tensor& tensor);
122
122
123
123
std::vector<Dimname> compute_diagonal_outnames (
124
124
const Tensor& tensor,
@@ -127,40 +127,40 @@ std::vector<Dimname> compute_diagonal_outnames(
127
127
128
128
// TensorImpl* overloads for Legacy TH/THC code. Use these sparingly.
129
129
130
- CAFFE2_API TensorImpl* propagate_names_if_nonempty (
130
+ TORCH_API TensorImpl* propagate_names_if_nonempty (
131
131
TensorImpl* result,
132
132
DimnameList maybe_names,
133
133
bool validate_names = false );
134
134
135
- CAFFE2_API TensorImpl* propagate_names (
135
+ TORCH_API TensorImpl* propagate_names (
136
136
TensorImpl* result,
137
137
DimnameList names,
138
138
bool validate_names = false );
139
139
140
- CAFFE2_API void propagate_names (TensorImpl* result, /* const */ TensorImpl* src);
140
+ TORCH_API void propagate_names (TensorImpl* result, /* const */ TensorImpl* src);
141
141
142
142
// result = m1 @ m2 + bias
143
- CAFFE2_API void propagate_names_for_addmm (
143
+ TORCH_API void propagate_names_for_addmm (
144
144
Tensor& result,
145
145
const Tensor& m1,
146
146
const Tensor& m2,
147
147
const Tensor& bias);
148
148
149
- CAFFE2_API void propagate_names_for_addmv (
149
+ TORCH_API void propagate_names_for_addmv (
150
150
Tensor& result,
151
151
const Tensor& mat,
152
152
const Tensor& vec,
153
153
const Tensor& bias);
154
154
155
- CAFFE2_API void check_names_for_dot (TensorImpl* vec1, TensorImpl* vec2);
155
+ TORCH_API void check_names_for_dot (TensorImpl* vec1, TensorImpl* vec2);
156
156
157
- CAFFE2_API std::vector<Dimname> compute_baddbmm_outnames (
157
+ TORCH_API std::vector<Dimname> compute_baddbmm_outnames (
158
158
Tensor& result,
159
159
const Tensor& self,
160
160
const Tensor& other,
161
161
const Tensor& bias);
162
162
163
- CAFFE2_API bool are_names_equal (TensorImpl* self, TensorImpl* other);
163
+ TORCH_API bool are_names_equal (TensorImpl* self, TensorImpl* other);
164
164
165
165
} // namespace namedinference
166
166
0 commit comments