Skip to main content

Module tensor_helpers

Module tensor_helpers 

Source

Traits§

ToIntList
Helper trait to convert usize arrays to i64 for IntList compatibility

Functions§

broadcast_add
Helper for broadcast addition
broadcast_mul
Helper for broadcast multiplication
broadcast_sub
Helper for broadcast subtraction
cat_tensors
Helper for concatenating tensors
clone_tensor
Helper for tensor cloning (Tch requires output tensor)
dims3
Get dimensions as 3-tuple
dims4
Get dimensions as 4-tuple
get_dtype
Helper for getting tensor dtype (Tch uses kind())
matmul
Helper for matmul operations
scalar_tensor
Create a scalar tensor from a value with specified dtype
square_tensor
Helper for squared tensor (sqr -> square)
to_dtype
Helper for converting to dtype with proper arguments
to_vec1
Helper to convert tensor to vec