Crate hpt_macros

Source
Expand description

§Tensor Macros

This crate provides a set of macros to generate code for tensor operations. These macros are used to simplify and automate common tasks such as defining tensor operations, reducing dimensionality, and optimizing numerical computations.

§Examples

Here’s an example of using a macro from this crate:

// Example code using a macro from this crate

Macros§

conv2d_microkernel_declare_const
declare const values
conv2d_microkernel_gen_inps
generate conv2d inps
conv2d_microkernel_gen_kernels
generate conv2d kernels
conv2d_microkernel_gen_pad_inps
generate conv2d inps
conv2d_microkernel_gen_results
generate conv2d repeat results
dwconv2d_microkernel_gen_pad_inps
generate conv2d inps
dwconv2d_microkernel_gen_results
generate conv2d repeat results
float_out_binary
implement float out binary trait
float_out_binary_simd
implement simd float out binary trait
float_out_binary_simd_with_lhs_scalar
implement simd float out binary trait with lhs scalar
float_out_binary_simd_with_rhs_scalar
implement simd float out binary trait with rhs scalar
float_out_unary
implement float out unary trait
gen_fast_layernorm_simd_helper
generate fast layernorm simd helper
gen_fast_reduce_simd_helper
generate fast reduce simd helper
gen_reduce_dim_not_include_simd_helper
generate reduce dim not include simd helper
impl_bitwise_out
implement bitwise out trait
impl_cmp
implement compare trait
impl_cmp_cuda
implement compare trait
impl_cuda_bitwise_out
implement bitwise out trait
impl_eval
implement eval trait
impl_from_scalar
implement from scalar trait
impl_into_scalar
implment into scalar trait
impl_into_vec
implment into vec trait
impl_normal_out_binary
generate notmal out trait
impl_normal_out_simd
implement simd normal out trait
impl_normal_out_simd_with_lhs_scalar
implement simd normal out trait with lhs scalar
impl_normal_out_simd_with_rhs_scalar
implement simd normal out trait with rhs scalar
impl_normal_out_unary
gemerate normal out unary trait
impl_normal_out_unary_simd
gemerate normal out unary trait
impl_scalar_convert
implement scalar convert trait
maxpool2d_microkernel_gen_results
generate maxpool2d kernels generate conv2d repeat results
pwconv2d_microkernel_gen_pad_inps
generate pwconv2d inps
select
parse the input and generate the corresponding slice
simd_bitwise
implement simd bitwise trait
simd_cmp
implement simd cmp trait
simd_eval
implement simd eval trait
simd_float_out_unary
implement simd float out unary trait

Derive Macros§

FromSafeTensors
generate from safetensors trait
Load
generate load trait
Save
generate save trait