@@ -163,7 +163,7 @@ TensorBase _empty_generic(
163
163
c10::Allocator* allocator,
164
164
c10::DispatchKeySet ks,
165
165
ScalarType scalar_type,
166
- c10 ::optional<c10::MemoryFormat> memory_format_opt) {
166
+ std ::optional<c10::MemoryFormat> memory_format_opt) {
167
167
at::detail::check_size_nonnegative (size);
168
168
at::detail::raise_warning_for_complex_half (scalar_type);
169
169
caffe2::TypeMeta dtype = scalarTypeToTypeMeta (scalar_type);
@@ -197,7 +197,7 @@ TensorBase empty_generic(
197
197
c10::Allocator* allocator,
198
198
c10::DispatchKeySet ks,
199
199
ScalarType scalar_type,
200
- c10 ::optional<c10::MemoryFormat> memory_format_opt) {
200
+ std ::optional<c10::MemoryFormat> memory_format_opt) {
201
201
return _empty_generic (size, allocator, ks, scalar_type, memory_format_opt);
202
202
}
203
203
@@ -206,7 +206,7 @@ TensorBase empty_generic_symint(
206
206
c10::Allocator* allocator,
207
207
c10::DispatchKeySet ks,
208
208
ScalarType scalar_type,
209
- c10 ::optional<c10::MemoryFormat> memory_format_opt) {
209
+ std ::optional<c10::MemoryFormat> memory_format_opt) {
210
210
return _empty_generic (size, allocator, ks, scalar_type, memory_format_opt);
211
211
}
212
212
@@ -252,19 +252,19 @@ TensorBase empty_strided_symint_generic(
252
252
}
253
253
254
254
TensorBase empty_cpu (IntArrayRef size, ScalarType dtype, bool pin_memory,
255
- c10 ::optional<c10::MemoryFormat> memory_format_opt) {
255
+ std ::optional<c10::MemoryFormat> memory_format_opt) {
256
256
auto allocator = GetCPUAllocatorMaybePinned (pin_memory);
257
257
constexpr c10::DispatchKeySet cpu_ks (c10::DispatchKey::CPU);
258
258
return empty_generic (size, allocator, cpu_ks, dtype, memory_format_opt);
259
259
}
260
260
261
261
TensorBase empty_cpu (
262
262
IntArrayRef size,
263
- c10 ::optional<ScalarType> dtype_opt,
264
- c10 ::optional<Layout> layout_opt,
265
- c10 ::optional<Device> device_opt,
266
- c10 ::optional<bool > pin_memory_opt,
267
- c10 ::optional<c10::MemoryFormat> memory_format_opt) {
263
+ std ::optional<ScalarType> dtype_opt,
264
+ std ::optional<Layout> layout_opt,
265
+ std ::optional<Device> device_opt,
266
+ std ::optional<bool > pin_memory_opt,
267
+ std ::optional<c10::MemoryFormat> memory_format_opt) {
268
268
TORCH_INTERNAL_ASSERT_DEBUG_ONLY (device_or_default (device_opt).type () == DeviceType::CPU);
269
269
TORCH_INTERNAL_ASSERT_DEBUG_ONLY (layout_or_default (layout_opt) == Layout::Strided);
270
270
@@ -295,10 +295,10 @@ TensorBase empty_strided_cpu(IntArrayRef size, IntArrayRef stride,
295
295
TensorBase empty_strided_cpu (
296
296
IntArrayRef size,
297
297
IntArrayRef stride,
298
- c10 ::optional<ScalarType> dtype_opt,
299
- c10 ::optional<Layout> layout_opt,
300
- c10 ::optional<Device> device_opt,
301
- c10 ::optional<bool > pin_memory_opt) {
298
+ std ::optional<ScalarType> dtype_opt,
299
+ std ::optional<Layout> layout_opt,
300
+ std ::optional<Device> device_opt,
301
+ std ::optional<bool > pin_memory_opt) {
302
302
TORCH_INTERNAL_ASSERT_DEBUG_ONLY (device_or_default (device_opt).type () == DeviceType::CPU);
303
303
TORCH_INTERNAL_ASSERT_DEBUG_ONLY (layout_or_default (layout_opt) == Layout::Strided);
304
304
@@ -342,7 +342,7 @@ static MetaAllocator g_meta_alloc;
342
342
REGISTER_ALLOCATOR (kMeta , &g_meta_alloc);
343
343
344
344
TensorBase empty_meta (IntArrayRef size, ScalarType dtype,
345
- c10 ::optional<c10::MemoryFormat> memory_format_opt) {
345
+ std ::optional<c10::MemoryFormat> memory_format_opt) {
346
346
auto *allocator = GetAllocator (kMeta );
347
347
constexpr c10::DispatchKeySet meta_dks (c10::DispatchKey::Meta);
348
348
return at::detail::empty_generic (
@@ -351,11 +351,11 @@ TensorBase empty_meta(IntArrayRef size, ScalarType dtype,
351
351
352
352
TensorBase empty_meta (
353
353
IntArrayRef size,
354
- c10 ::optional<ScalarType> dtype_opt,
355
- c10 ::optional<Layout> layout_opt,
356
- c10 ::optional<Device> device_opt,
357
- c10 ::optional<bool > pin_memory_opt,
358
- c10 ::optional<c10::MemoryFormat> memory_format_opt
354
+ std ::optional<ScalarType> dtype_opt,
355
+ std ::optional<Layout> layout_opt,
356
+ std ::optional<Device> device_opt,
357
+ std ::optional<bool > pin_memory_opt,
358
+ std ::optional<c10::MemoryFormat> memory_format_opt
359
359
) {
360
360
TORCH_INTERNAL_ASSERT_DEBUG_ONLY (device_or_default (device_opt).type () == DeviceType::Meta);
361
361
// NB: because there is no SparseMeta (yet), non-strided layout is
@@ -371,11 +371,11 @@ TensorBase empty_meta(
371
371
372
372
TensorBase empty_symint_meta (
373
373
SymIntArrayRef size,
374
- c10 ::optional<ScalarType> dtype_opt,
375
- c10 ::optional<Layout> layout_opt,
376
- c10 ::optional<Device> device_opt,
377
- c10 ::optional<bool > pin_memory_opt,
378
- c10 ::optional<c10::MemoryFormat> memory_format_opt
374
+ std ::optional<ScalarType> dtype_opt,
375
+ std ::optional<Layout> layout_opt,
376
+ std ::optional<Device> device_opt,
377
+ std ::optional<bool > pin_memory_opt,
378
+ std ::optional<c10::MemoryFormat> memory_format_opt
379
379
) {
380
380
auto *allocator = GetAllocator (kMeta );
381
381
constexpr c10::DispatchKeySet ks (c10::DispatchKey::Meta);
@@ -405,10 +405,10 @@ TensorBase empty_strided_meta(IntArrayRef size, IntArrayRef stride,
405
405
TensorBase empty_strided_meta (
406
406
IntArrayRef size,
407
407
IntArrayRef stride,
408
- c10 ::optional<ScalarType> dtype_opt,
409
- c10 ::optional<Layout> layout_opt,
410
- c10 ::optional<Device> device_opt,
411
- c10 ::optional<bool > pin_memory_opt) {
408
+ std ::optional<ScalarType> dtype_opt,
409
+ std ::optional<Layout> layout_opt,
410
+ std ::optional<Device> device_opt,
411
+ std ::optional<bool > pin_memory_opt) {
412
412
TORCH_INTERNAL_ASSERT_DEBUG_ONLY (device_or_default (device_opt).type () == DeviceType::Meta);
413
413
TORCH_INTERNAL_ASSERT_DEBUG_ONLY (layout_or_default (layout_opt) == Layout::Strided);
414
414
@@ -440,10 +440,10 @@ TensorBase empty_strided_symint_meta(SymIntArrayRef size, SymIntArrayRef stride,
440
440
TensorBase empty_strided_symint_meta (
441
441
SymIntArrayRef size,
442
442
SymIntArrayRef stride,
443
- c10 ::optional<ScalarType> dtype_opt,
444
- c10 ::optional<Layout> layout_opt,
445
- c10 ::optional<Device> device_opt,
446
- c10 ::optional<bool > pin_memory_opt) {
443
+ std ::optional<ScalarType> dtype_opt,
444
+ std ::optional<Layout> layout_opt,
445
+ std ::optional<Device> device_opt,
446
+ std ::optional<bool > pin_memory_opt) {
447
447
TORCH_INTERNAL_ASSERT_DEBUG_ONLY (device_or_default (device_opt).type () == DeviceType::Meta);
448
448
TORCH_INTERNAL_ASSERT_DEBUG_ONLY (layout_or_default (layout_opt) == Layout::Strided);
449
449
0 commit comments