Dispatching¶
Convenience macros to dispath functions based on tensor data type.
-
AUGPY_DISPATCH(TYPE, NAME, ...)¶ Dispatch all dtypes. Declares tensor dtype as
scalar_t, signed version of dtype assscalar_t, andfloat(8, 16 bits)double(32, 64 bits) astemp_t.- Parameters
TYPE: tensor dtype, see DLDataTypeNAME: name of the dispatched function; used when exceptions are thrown...: code to execute
-
AUGPY_DISPATCH_NOEXC(TYPE, NAME, ...)¶ Dispatch all dtypes. Does not throw exception when dtype cannot be dispatched. Declares tensor dtype as
scalar_t, signed version of dtype assscalar_t, andfloat(8, 16 bits)double(32, 64 bits) astemp_t.- Parameters
TYPE: tensor dtype, see DLDataTypeNAME: name of the dispatched function; used when exceptions are thrown...: code to execute
-
AUGPY_DISPATCH_F(TYPE, NAME, ...)¶ Dispatch all dtypes that can use
floatas temp_t. Declares tensor dtype asscalar_t, signed version of dtype assscalar_t, andfloatastemp_t.- Parameters
TYPE: tensor dtype, see DLDataTypeNAME: name of the dispatched function; used when exceptions are thrown...: code to execute
-
AUGPY_DISPATCH_F_NOEXC(TYPE, NAME, ...)¶ Dispatch all dtypes that can use
floatas temp_t. Does not throw exception when dtype cannot be dispatched. Declares tensor dtype asscalar_t, signed version of dtype assscalar_t, andfloatastemp_t.- Parameters
TYPE: tensor dtype, see DLDataTypeNAME: name of the dispatched function; used when exceptions are thrown...: code to execute
-
AUGPY_DISPATCH_D(TYPE, NAME, ...)¶ Dispatch all dtypes that must use
doubleas temp_t. Declares tensor dtype asscalar_t, signed version of dtype assscalar_t, anddoubleastemp_t.- Parameters
TYPE: tensor dtype, see DLDataTypeNAME: name of the dispatched function; used when exceptions are thrown...: code to execute
-
AUGPY_DISPATCH_D_NOEXC(TYPE, NAME, ...)¶ Dispatch all dtypes that must use
doubleas temp_t. Does not throw exception when dtype cannot be dispatched. Declares tensor dtype asscalar_t, signed version of dtype assscalar_t, anddoubleastemp_t.- Parameters
TYPE: tensor dtype, see DLDataTypeNAME: name of the dispatched function; used when exceptions are thrown...: code to execute