@@ -30,7 +30,7 @@ namespace extension {
30
30
* It serves as a safer, more convenient alternative to the original TensorImpl,
31
31
* which does not manage its metadata by design.
32
32
*/
33
- using TensorImplPtr = std::shared_ptr<exec_aten ::TensorImpl>;
33
+ using TensorImplPtr = std::shared_ptr<executorch::aten ::TensorImpl>;
34
34
#else
35
35
/* *
36
36
* A smart pointer type for managing the lifecycle of a TensorImpl.
@@ -40,7 +40,7 @@ using TensorImplPtr = std::shared_ptr<exec_aten::TensorImpl>;
40
40
* metadata.
41
41
*/
42
42
using TensorImplPtr =
43
- c10::intrusive_ptr<exec_aten ::TensorImpl, at::UndefinedTensorImpl>;
43
+ c10::intrusive_ptr<executorch::aten ::TensorImpl, at::UndefinedTensorImpl>;
44
44
#endif // USE_ATEN_LIB
45
45
46
46
/* *
@@ -59,13 +59,13 @@ using TensorImplPtr =
59
59
* @return A TensorImplPtr managing the newly created TensorImpl.
60
60
*/
61
61
TensorImplPtr make_tensor_impl_ptr (
62
- std::vector<exec_aten ::SizesType> sizes,
62
+ std::vector<executorch::aten ::SizesType> sizes,
63
63
void * data,
64
- std::vector<exec_aten ::DimOrderType> dim_order,
65
- std::vector<exec_aten ::StridesType> strides,
66
- exec_aten:: ScalarType type = exec_aten ::ScalarType::Float,
67
- exec_aten ::TensorShapeDynamism dynamism =
68
- exec_aten ::TensorShapeDynamism::DYNAMIC_BOUND,
64
+ std::vector<executorch::aten ::DimOrderType> dim_order,
65
+ std::vector<executorch::aten ::StridesType> strides,
66
+ executorch::aten:: ScalarType type = executorch::aten ::ScalarType::Float,
67
+ executorch::aten ::TensorShapeDynamism dynamism =
68
+ executorch::aten ::TensorShapeDynamism::DYNAMIC_BOUND,
69
69
std::function<void (void *)> deleter = nullptr);
70
70
71
71
/* *
@@ -82,11 +82,11 @@ TensorImplPtr make_tensor_impl_ptr(
82
82
* @return A TensorImplPtr managing the newly created TensorImpl.
83
83
*/
84
84
inline TensorImplPtr make_tensor_impl_ptr (
85
- std::vector<exec_aten ::SizesType> sizes,
85
+ std::vector<executorch::aten ::SizesType> sizes,
86
86
void * data,
87
- exec_aten:: ScalarType type = exec_aten ::ScalarType::Float,
88
- exec_aten ::TensorShapeDynamism dynamism =
89
- exec_aten ::TensorShapeDynamism::DYNAMIC_BOUND,
87
+ executorch::aten:: ScalarType type = executorch::aten ::ScalarType::Float,
88
+ executorch::aten ::TensorShapeDynamism dynamism =
89
+ executorch::aten ::TensorShapeDynamism::DYNAMIC_BOUND,
90
90
std::function<void (void *)> deleter = nullptr) {
91
91
return make_tensor_impl_ptr (
92
92
std::move (sizes), data, {}, {}, type, dynamism, std::move (deleter));
@@ -114,15 +114,16 @@ inline TensorImplPtr make_tensor_impl_ptr(
114
114
*/
115
115
template <
116
116
typename T = float ,
117
- exec_aten::ScalarType deduced_type = runtime::CppTypeToScalarType<T>::value>
117
+ executorch::aten::ScalarType deduced_type =
118
+ runtime::CppTypeToScalarType<T>::value>
118
119
TensorImplPtr make_tensor_impl_ptr (
119
- std::vector<exec_aten ::SizesType> sizes,
120
+ std::vector<executorch::aten ::SizesType> sizes,
120
121
std::vector<T> data,
121
- std::vector<exec_aten ::DimOrderType> dim_order = {},
122
- std::vector<exec_aten ::StridesType> strides = {},
123
- exec_aten ::ScalarType type = deduced_type,
124
- exec_aten ::TensorShapeDynamism dynamism =
125
- exec_aten ::TensorShapeDynamism::DYNAMIC_BOUND) {
122
+ std::vector<executorch::aten ::DimOrderType> dim_order = {},
123
+ std::vector<executorch::aten ::StridesType> strides = {},
124
+ executorch::aten ::ScalarType type = deduced_type,
125
+ executorch::aten ::TensorShapeDynamism dynamism =
126
+ executorch::aten ::TensorShapeDynamism::DYNAMIC_BOUND) {
126
127
if (type != deduced_type) {
127
128
ET_CHECK_MSG (
128
129
runtime::canCast (deduced_type, type),
@@ -179,13 +180,15 @@ TensorImplPtr make_tensor_impl_ptr(
179
180
*/
180
181
template <
181
182
typename T = float ,
182
- exec_aten::ScalarType deduced_type = runtime::CppTypeToScalarType<T>::value>
183
+ executorch::aten::ScalarType deduced_type =
184
+ runtime::CppTypeToScalarType<T>::value>
183
185
inline TensorImplPtr make_tensor_impl_ptr (
184
186
std::vector<T> data,
185
- exec_aten::ScalarType type = deduced_type,
186
- exec_aten::TensorShapeDynamism dynamism =
187
- exec_aten::TensorShapeDynamism::DYNAMIC_BOUND) {
188
- std::vector<exec_aten::SizesType> sizes{exec_aten::SizesType (data.size ())};
187
+ executorch::aten::ScalarType type = deduced_type,
188
+ executorch::aten::TensorShapeDynamism dynamism =
189
+ executorch::aten::TensorShapeDynamism::DYNAMIC_BOUND) {
190
+ std::vector<executorch::aten::SizesType> sizes{
191
+ executorch::aten::SizesType (data.size ())};
189
192
return make_tensor_impl_ptr (
190
193
std::move (sizes), std::move (data), {0 }, {1 }, type, dynamism);
191
194
}
@@ -213,15 +216,16 @@ inline TensorImplPtr make_tensor_impl_ptr(
213
216
*/
214
217
template <
215
218
typename T = float ,
216
- exec_aten::ScalarType deduced_type = runtime::CppTypeToScalarType<T>::value>
219
+ executorch::aten::ScalarType deduced_type =
220
+ runtime::CppTypeToScalarType<T>::value>
217
221
inline TensorImplPtr make_tensor_impl_ptr (
218
- std::vector<exec_aten ::SizesType> sizes,
222
+ std::vector<executorch::aten ::SizesType> sizes,
219
223
std::initializer_list<T> list,
220
- std::vector<exec_aten ::DimOrderType> dim_order = {},
221
- std::vector<exec_aten ::StridesType> strides = {},
222
- exec_aten ::ScalarType type = deduced_type,
223
- exec_aten ::TensorShapeDynamism dynamism =
224
- exec_aten ::TensorShapeDynamism::DYNAMIC_BOUND) {
224
+ std::vector<executorch::aten ::DimOrderType> dim_order = {},
225
+ std::vector<executorch::aten ::StridesType> strides = {},
226
+ executorch::aten ::ScalarType type = deduced_type,
227
+ executorch::aten ::TensorShapeDynamism dynamism =
228
+ executorch::aten ::TensorShapeDynamism::DYNAMIC_BOUND) {
225
229
return make_tensor_impl_ptr (
226
230
std::move (sizes),
227
231
std::vector<T>(std::move (list)),
@@ -251,13 +255,15 @@ inline TensorImplPtr make_tensor_impl_ptr(
251
255
*/
252
256
template <
253
257
typename T = float ,
254
- exec_aten::ScalarType deduced_type = runtime::CppTypeToScalarType<T>::value>
258
+ executorch::aten::ScalarType deduced_type =
259
+ runtime::CppTypeToScalarType<T>::value>
255
260
inline TensorImplPtr make_tensor_impl_ptr (
256
261
std::initializer_list<T> list,
257
- exec_aten::ScalarType type = deduced_type,
258
- exec_aten::TensorShapeDynamism dynamism =
259
- exec_aten::TensorShapeDynamism::DYNAMIC_BOUND) {
260
- std::vector<exec_aten::SizesType> sizes{exec_aten::SizesType (list.size ())};
262
+ executorch::aten::ScalarType type = deduced_type,
263
+ executorch::aten::TensorShapeDynamism dynamism =
264
+ executorch::aten::TensorShapeDynamism::DYNAMIC_BOUND) {
265
+ std::vector<executorch::aten::SizesType> sizes{
266
+ executorch::aten::SizesType (list.size ())};
261
267
return make_tensor_impl_ptr (
262
268
std::move (sizes), std::move (list), {0 }, {1 }, type, dynamism);
263
269
}
@@ -291,13 +297,13 @@ inline TensorImplPtr make_tensor_impl_ptr(T value) {
291
297
* @return A TensorImplPtr managing the newly created TensorImpl.
292
298
*/
293
299
TensorImplPtr make_tensor_impl_ptr (
294
- std::vector<exec_aten ::SizesType> sizes,
300
+ std::vector<executorch::aten ::SizesType> sizes,
295
301
std::vector<uint8_t > data,
296
- std::vector<exec_aten ::DimOrderType> dim_order,
297
- std::vector<exec_aten ::StridesType> strides,
298
- exec_aten:: ScalarType type = exec_aten ::ScalarType::Float,
299
- exec_aten ::TensorShapeDynamism dynamism =
300
- exec_aten ::TensorShapeDynamism::DYNAMIC_BOUND);
302
+ std::vector<executorch::aten ::DimOrderType> dim_order,
303
+ std::vector<executorch::aten ::StridesType> strides,
304
+ executorch::aten:: ScalarType type = executorch::aten ::ScalarType::Float,
305
+ executorch::aten ::TensorShapeDynamism dynamism =
306
+ executorch::aten ::TensorShapeDynamism::DYNAMIC_BOUND);
301
307
302
308
/* *
303
309
* Creates a TensorImplPtr that manages a newly created TensorImpl with the
@@ -314,11 +320,11 @@ TensorImplPtr make_tensor_impl_ptr(
314
320
* @return A TensorImplPtr managing the newly created TensorImpl.
315
321
*/
316
322
inline TensorImplPtr make_tensor_impl_ptr (
317
- std::vector<exec_aten ::SizesType> sizes,
323
+ std::vector<executorch::aten ::SizesType> sizes,
318
324
std::vector<uint8_t > data,
319
- exec_aten:: ScalarType type = exec_aten ::ScalarType::Float,
320
- exec_aten ::TensorShapeDynamism dynamism =
321
- exec_aten ::TensorShapeDynamism::DYNAMIC_BOUND) {
325
+ executorch::aten:: ScalarType type = executorch::aten ::ScalarType::Float,
326
+ executorch::aten ::TensorShapeDynamism dynamism =
327
+ executorch::aten ::TensorShapeDynamism::DYNAMIC_BOUND) {
322
328
return make_tensor_impl_ptr (
323
329
std::move (sizes), std::move (data), {}, {}, type, dynamism);
324
330
}
0 commit comments