Commit 12449fe
committed
Update on "[slimtensor] Add utility functions to common_shims_slim"
Add utility functions to the header-only common_shims_slim library:
1. DType constants:
- `aoti_torch_dtype_float32()` - Returns 6 (ScalarType::Float)
- `aoti_torch_dtype_bfloat16()` - Returns 15 (ScalarType::BFloat16)
- `aoti_torch_dtype_int64()` - Returns 4 (ScalarType::Long)
- `aoti_torch_dtype_int32()` - Returns 3 (ScalarType::Int)
- `aoti_torch_dtype_int16()` - Returns 2 (ScalarType::Short)
- `aoti_torch_dtype_int8()` - Returns 1 (ScalarType::Char)
- `aoti_torch_dtype_bool()` - Returns 11 (ScalarType::Bool)
2. Device type constants:
- `aoti_torch_device_type_cpu()` - Returns 0 (DeviceType::CPU)
- `aoti_torch_device_type_cuda()` - Returns 1 (DeviceType::CUDA)
3. Grad mode functions (not supported in ExecuTorch):
- `aoti_torch_grad_mode_is_enabled()` - Always returns false
- `aoti_torch_grad_mode_set_enabled()` - Returns Ok for false, NotSupported for true
Differential Revision: [D90126250](https://our.internmc.facebook.com/intern/diff/D90126250/)
[ghstack-poisoned]0 file changed
0 commit comments