eduardo4jesus:

The documentation, here here, does not provide an alternative to x.type().


As the warning suggests t.options() to get something that can be used with the factory functions and the getters of individual things (e.g. t.scalar_type() for the ScalarType aka dtype).
Do you want a pointer or an array-like object? If you want the pointer you got from .data before, it’s now called .data_ptr, which is a drop-in replacement.
If you want an array type object: .packed_accessor32 (preferred over the version with size_t if you know it is sufficient) has 3=dimension of the tensor (fixed at compile time, checked at runtime) and the traits (DefaultPtrTraits is without extra qualification, Restricted adds the __restrict__ to the type, meaning that the compiler may assume that the tensor does not overlap with (written-to) tensors, which allows more aggressive caching.
The first is the C/CUDA data element type of the tensor (fixed at compile time, checked at runtime). The latter should ideally not be size_t but int32_t if that works or int64_t and is the datatype for the indexing arithmetic (32bit is much faster than 64bit on CUDA).
Best regards
Thomas