pub struct LibTorch<E = f32> { /* private fields */ }Expand description
Tensor backend that uses LibTorch with the tch crate for executing tensor operations.
This backend is compatible with a wide range of hardwares ranging from CPUs to GPUs, but
requires LibTorch to be installed correctly. The CPU version can be downloaded
automatically and the CUDA version as well by setting the TORCH_CUDA_VERSION environment
variable. For more complex configurations, check out the manual installation for
burn-tch.
Refer to the tch crate for more information.
Trait Implementations§
Source§impl<E: TchElement> ActivationOps<LibTorch<E>> for LibTorch<E>
impl<E: TchElement> ActivationOps<LibTorch<E>> for LibTorch<E>
Source§fn gelu_backward(tensor: TchTensor, grad: TchTensor) -> TchTensor
fn gelu_backward(tensor: TchTensor, grad: TchTensor) -> TchTensor
Applies the Gelu activation function backward. Read more
Source§fn log_sigmoid(tensor: TchTensor) -> TchTensor
fn log_sigmoid(tensor: TchTensor) -> TchTensor
Applies the LogSigmoid activation function. Read more
Source§fn leaky_relu(
tensor: <B as Backend>::FloatTensorPrimitive,
negative_slope: <B as Backend>::FloatElem,
) -> <B as Backend>::FloatTensorPrimitive
fn leaky_relu( tensor: <B as Backend>::FloatTensorPrimitive, negative_slope: <B as Backend>::FloatElem, ) -> <B as Backend>::FloatTensorPrimitive
Applies the LeakyReLU activation function. Read more
Source§fn relu_backward(
output: <B as Backend>::FloatTensorPrimitive,
grad: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn relu_backward( output: <B as Backend>::FloatTensorPrimitive, grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
Applies the ReLU activation function backward. Read more
Source§fn prelu(
tensor: <B as Backend>::FloatTensorPrimitive,
alpha: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn prelu( tensor: <B as Backend>::FloatTensorPrimitive, alpha: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
Applies the PReLu activation function. Read more
Source§fn sigmoid_backward(
output: <B as Backend>::FloatTensorPrimitive,
grad: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn sigmoid_backward( output: <B as Backend>::FloatTensorPrimitive, grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
Applies the Sigmoid activation function backward. Read more
Source§fn hard_sigmoid(
tensor: <B as Backend>::FloatTensorPrimitive,
alpha: <B as Backend>::FloatElem,
beta: <B as Backend>::FloatElem,
) -> <B as Backend>::FloatTensorPrimitive
fn hard_sigmoid( tensor: <B as Backend>::FloatTensorPrimitive, alpha: <B as Backend>::FloatElem, beta: <B as Backend>::FloatElem, ) -> <B as Backend>::FloatTensorPrimitive
Applies the hard Sigmoid activation function. Read more
Source§fn log_sigmoid_backward(
x: <B as Backend>::FloatTensorPrimitive,
grad: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn log_sigmoid_backward( x: <B as Backend>::FloatTensorPrimitive, grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
Applies the LogSigmoid activation function backward. Read more
Source§impl<E: TchElement> Backend for LibTorch<E>
impl<E: TchElement> Backend for LibTorch<E>
Source§type Device = LibTorchDevice
type Device = LibTorchDevice
Device type.
Source§type FloatTensorPrimitive = TchTensor
type FloatTensorPrimitive = TchTensor
Tensor primitive to be used for all float operations.
Source§type IntTensorPrimitive = TchTensor
type IntTensorPrimitive = TchTensor
Tensor primitive to be used for all int operations.
Source§type BoolTensorPrimitive = TchTensor
type BoolTensorPrimitive = TchTensor
Tensor primitive to be used for all bool operations.
Source§type QuantizedTensorPrimitive = TchTensor
type QuantizedTensorPrimitive = TchTensor
Tensor primitive to be used for all quantized operations.
Source§fn seed(_device: &Self::Device, seed: u64)
fn seed(_device: &Self::Device, seed: u64)
Seeds the backend on the specified device. Read more
Source§fn ad_enabled() -> bool
fn ad_enabled() -> bool
If autodiff is enabled.
Source§fn memory_persistent_allocations<Output, Input, Func>(
device: &Self::Device,
input: Input,
func: Func,
) -> Outputwhere
Func: Fn(Input) -> Output,
fn memory_persistent_allocations<Output, Input, Func>(
device: &Self::Device,
input: Input,
func: Func,
) -> Outputwhere
Func: Fn(Input) -> Output,
Sets the current allocation mode to persistent.
Source§fn memory_cleanup(device: &Self::Device)
fn memory_cleanup(device: &Self::Device)
Manually triggers a memory cleanup on the given device.
Source§impl<E: TchElement> BoolTensorOps<LibTorch<E>> for LibTorch<E>
impl<E: TchElement> BoolTensorOps<LibTorch<E>> for LibTorch<E>
Source§fn bool_from_data(data: TensorData, device: &LibTorchDevice) -> TchTensor
fn bool_from_data(data: TensorData, device: &LibTorchDevice) -> TchTensor
Creates a tensor from the data structure. Read more
Source§fn bool_repeat_dim(tensor: TchTensor, dim: usize, times: usize) -> TchTensor
fn bool_repeat_dim(tensor: TchTensor, dim: usize, times: usize) -> TchTensor
Repeats one dimension of the tensor a given number of times along that dimension. Read more
Source§async fn bool_into_data(tensor: TchTensor) -> TensorData
async fn bool_into_data(tensor: TchTensor) -> TensorData
Converts the tensor to a data structure. Read more
Source§fn bool_to_device(tensor: TchTensor, device: &LibTorchDevice) -> TchTensor
fn bool_to_device(tensor: TchTensor, device: &LibTorchDevice) -> TchTensor
Moves the tensor to the device.
Source§fn bool_device(tensor: &TchTensor) -> LibTorchDevice
fn bool_device(tensor: &TchTensor) -> LibTorchDevice
Gets the device of the tensor. Read more
Source§fn bool_empty(
shape: Shape,
device: &<LibTorch<E> as Backend>::Device,
) -> TchTensor
fn bool_empty( shape: Shape, device: &<LibTorch<E> as Backend>::Device, ) -> TchTensor
Creates a new bool tensor. Read more
Source§fn bool_zeros(
shape: Shape,
device: &<LibTorch<E> as Backend>::Device,
) -> TchTensor
fn bool_zeros( shape: Shape, device: &<LibTorch<E> as Backend>::Device, ) -> TchTensor
Creates a new bool tensor filled false. Read more
Source§fn bool_ones(
shape: Shape,
device: &<LibTorch<E> as Backend>::Device,
) -> TchTensor
fn bool_ones( shape: Shape, device: &<LibTorch<E> as Backend>::Device, ) -> TchTensor
Creates a new bool tensor filled true. Read more
Source§fn bool_slice(tensor: TchTensor, slices: &[Slice]) -> TchTensor
fn bool_slice(tensor: TchTensor, slices: &[Slice]) -> TchTensor
Gets the values from the tensor for the given ranges. Read more
Source§fn bool_slice_assign(
tensor: TchTensor,
slices: &[Slice],
value: TchTensor,
) -> TchTensor
fn bool_slice_assign( tensor: TchTensor, slices: &[Slice], value: TchTensor, ) -> TchTensor
Sets the values in the tensor for the given ranges. Read more
Source§fn bool_cat(tensors: Vec<TchTensor>, dim: usize) -> TchTensor
fn bool_cat(tensors: Vec<TchTensor>, dim: usize) -> TchTensor
Concatenates the tensors along the given dimension. Read more
Source§fn bool_and(lhs: TchTensor, rhs: TchTensor) -> TchTensor
fn bool_and(lhs: TchTensor, rhs: TchTensor) -> TchTensor
Executes the logical and (
&&) operation on two boolean tensors. Read moreSource§fn bool_or(lhs: TchTensor, rhs: TchTensor) -> TchTensor
fn bool_or(lhs: TchTensor, rhs: TchTensor) -> TchTensor
Executes the logical or (
||) operation on two boolean tensors. Read moreSource§fn bool_into_int(tensor: TchTensor) -> TchTensor
fn bool_into_int(tensor: TchTensor) -> TchTensor
Converts bool tensor to int tensor. Read more
Source§fn bool_into_float(tensor: TchTensor) -> TchTensor
fn bool_into_float(tensor: TchTensor) -> TchTensor
Converts bool tensor to float tensor. Read more
Source§fn bool_swap_dims(tensor: TchTensor, dim1: usize, dim2: usize) -> TchTensor
fn bool_swap_dims(tensor: TchTensor, dim1: usize, dim2: usize) -> TchTensor
Swaps two dimensions of a bool tensor. Read more
Source§fn bool_permute(tensor: TchTensor, axes: &[usize]) -> TchTensor
fn bool_permute(tensor: TchTensor, axes: &[usize]) -> TchTensor
Permutes the dimensions of a tensor. Read more
Source§fn bool_flip(tensor: TchTensor, axes: &[usize]) -> TchTensor
fn bool_flip(tensor: TchTensor, axes: &[usize]) -> TchTensor
Reverse the order of elements in a tensor along the given axes. Read more
Source§async fn bool_argwhere(tensor: TchTensor) -> TchTensor
async fn bool_argwhere(tensor: TchTensor) -> TchTensor
Compute the indices of the elements that are non-zero, grouped by element. Read more
Source§fn bool_select(tensor: TchTensor, dim: usize, indices: TchTensor) -> TchTensor
fn bool_select(tensor: TchTensor, dim: usize, indices: TchTensor) -> TchTensor
Select tensor elements along the given dimension corresponding to the given indices. Read more
Source§fn bool_select_assign(
tensor: TchTensor,
dim: usize,
indices: TchTensor,
value: TchTensor,
) -> TchTensor
fn bool_select_assign( tensor: TchTensor, dim: usize, indices: TchTensor, value: TchTensor, ) -> TchTensor
Assign the selected elements along the given dimension corresponding to the given indices
to the given value. Read more
Source§fn bool_expand(tensor: TchTensor, shape: Shape) -> TchTensor
fn bool_expand(tensor: TchTensor, shape: Shape) -> TchTensor
Broadcasts the bool
tensor to the given shape.Source§fn bool_unfold(
tensor: IntTensor<Self>,
dim: usize,
size: usize,
step: usize,
) -> IntTensor<Self>
fn bool_unfold( tensor: IntTensor<Self>, dim: usize, size: usize, step: usize, ) -> IntTensor<Self>
Unfold windows along a dimension. Read more
Source§fn bool_not_equal(
lhs: <B as Backend>::BoolTensorPrimitive,
rhs: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_not_equal( lhs: <B as Backend>::BoolTensorPrimitive, rhs: <B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
Element-wise non-equality comparison. Read more
Source§fn bool_xor(
lhs: <B as Backend>::BoolTensorPrimitive,
rhs: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_xor( lhs: <B as Backend>::BoolTensorPrimitive, rhs: <B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
Element-wise exclusive or. Read more
Source§fn bool_transpose(
tensor: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_transpose( tensor: <B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
Transposes a bool tensor. Read more
Source§fn bool_any(
tensor: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_any( tensor: <B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
Tests if any element in the boolean
tensor evaluates to True. Read moreSource§fn bool_any_dim(
tensor: <B as Backend>::BoolTensorPrimitive,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_any_dim( tensor: <B as Backend>::BoolTensorPrimitive, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive
Source§fn bool_all(
tensor: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_all( tensor: <B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
Tests if all elements in the boolean
tensor evaluate to True. Read moreSource§fn bool_all_dim(
tensor: <B as Backend>::BoolTensorPrimitive,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_all_dim( tensor: <B as Backend>::BoolTensorPrimitive, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive
Source§impl<E: TchElement> FloatTensorOps<LibTorch<E>> for LibTorch<E>
impl<E: TchElement> FloatTensorOps<LibTorch<E>> for LibTorch<E>
Source§fn float_from_data(data: TensorData, device: &LibTorchDevice) -> TchTensor
fn float_from_data(data: TensorData, device: &LibTorchDevice) -> TchTensor
Creates a new tensor from the data structure. Read more
Source§fn float_random(
shape: Shape,
distribution: Distribution,
device: &LibTorchDevice,
) -> TchTensor
fn float_random( shape: Shape, distribution: Distribution, device: &LibTorchDevice, ) -> TchTensor
Creates a new tensor with random values. Read more
Source§fn float_repeat_dim(tensor: TchTensor, dim: usize, times: usize) -> TchTensor
fn float_repeat_dim(tensor: TchTensor, dim: usize, times: usize) -> TchTensor
Repeat the tensor along the given dimension. Read more
Source§fn float_zeros(
shape: Shape,
device: &LibTorchDevice,
dtype: FloatDType,
) -> TchTensor
fn float_zeros( shape: Shape, device: &LibTorchDevice, dtype: FloatDType, ) -> TchTensor
Creates a new tensor with zeros. Read more
Source§fn float_ones(
shape: Shape,
device: &LibTorchDevice,
dtype: FloatDType,
) -> TchTensor
fn float_ones( shape: Shape, device: &LibTorchDevice, dtype: FloatDType, ) -> TchTensor
Creates a new tensor with ones. Read more
Source§async fn float_into_data(tensor: TchTensor) -> TensorData
async fn float_into_data(tensor: TchTensor) -> TensorData
Converts the tensor to a data structure. Read more
Source§fn float_device(tensor: &TchTensor) -> LibTorchDevice
fn float_device(tensor: &TchTensor) -> LibTorchDevice
Gets the device of the tensor. Read more
Source§fn float_to_device(tensor: TchTensor, device: &LibTorchDevice) -> TchTensor
fn float_to_device(tensor: TchTensor, device: &LibTorchDevice) -> TchTensor
Moves the tensor to the given device. Read more
Source§fn float_empty(
shape: Shape,
device: &<LibTorch<E> as Backend>::Device,
dtype: FloatDType,
) -> TchTensor
fn float_empty( shape: Shape, device: &<LibTorch<E> as Backend>::Device, dtype: FloatDType, ) -> TchTensor
Creates an empty tensor with the given shape. Read more
Source§fn float_add(lhs: TchTensor, rhs: TchTensor) -> TchTensor
fn float_add(lhs: TchTensor, rhs: TchTensor) -> TchTensor
Adds two tensors together. Read more
Source§fn float_sub_scalar(lhs: TchTensor, rhs: E) -> TchTensor
fn float_sub_scalar(lhs: TchTensor, rhs: E) -> TchTensor
Subtracts a scalar from a tensor. Read more
Source§fn float_mul(lhs: TchTensor, rhs: TchTensor) -> TchTensor
fn float_mul(lhs: TchTensor, rhs: TchTensor) -> TchTensor
Multiplies two tensors together element-wise.
Source§fn float_mul_scalar(lhs: TchTensor, rhs: E) -> TchTensor
fn float_mul_scalar(lhs: TchTensor, rhs: E) -> TchTensor
Multiplies a tensor by a scalar. Read more
Source§fn float_div(lhs: TchTensor, rhs: TchTensor) -> TchTensor
fn float_div(lhs: TchTensor, rhs: TchTensor) -> TchTensor
Divides two tensors element-wise. Read more
Source§fn float_div_scalar(lhs: TchTensor, rhs: E) -> TchTensor
fn float_div_scalar(lhs: TchTensor, rhs: E) -> TchTensor
Divides a tensor by a scalar. Read more
Source§fn float_remainder(lhs: TchTensor, rhs: TchTensor) -> TchTensor
fn float_remainder(lhs: TchTensor, rhs: TchTensor) -> TchTensor
Computes the remainder of division between two tensors element-wise. Read more
Source§fn float_remainder_scalar(lhs: TchTensor, rhs: E) -> TchTensor
fn float_remainder_scalar(lhs: TchTensor, rhs: E) -> TchTensor
Computes the modulus of a tensor given a scalar. Read more
Source§fn float_matmul(lhs: TchTensor, rhs: TchTensor) -> TchTensor
fn float_matmul(lhs: TchTensor, rhs: TchTensor) -> TchTensor
Multiplies two tensors together using matrix multiplication. Read more
Source§fn float_cross(lhs: TchTensor, rhs: TchTensor, dim: usize) -> TchTensor
fn float_cross(lhs: TchTensor, rhs: TchTensor, dim: usize) -> TchTensor
Computes the cross product of two tensors along a given dimension. Read more
Source§fn float_recip(tensor: TchTensor) -> TchTensor
fn float_recip(tensor: TchTensor) -> TchTensor
Calculates the reciprocals element-wise
Source§fn float_swap_dims(tensor: TchTensor, dim1: usize, dim2: usize) -> TchTensor
fn float_swap_dims(tensor: TchTensor, dim1: usize, dim2: usize) -> TchTensor
Swaps two dimensions of a tensor. Read more
Source§fn float_gather(dim: usize, tensor: TchTensor, indices: TchTensor) -> TchTensor
fn float_gather(dim: usize, tensor: TchTensor, indices: TchTensor) -> TchTensor
Gather elements from a tensor. Read more
Source§fn float_scatter(
dim: usize,
tensor: TchTensor,
indices: TchTensor,
value: TchTensor,
) -> TchTensor
fn float_scatter( dim: usize, tensor: TchTensor, indices: TchTensor, value: TchTensor, ) -> TchTensor
Scatter elements into a tensor. Read more
Source§fn float_select(tensor: TchTensor, dim: usize, indices: TchTensor) -> TchTensor
fn float_select(tensor: TchTensor, dim: usize, indices: TchTensor) -> TchTensor
Select tensor elements along the given dimension corresponding for the given indices. Read more
Source§fn float_select_assign(
tensor: TchTensor,
dim: usize,
indices: TchTensor,
value: TchTensor,
) -> TchTensor
fn float_select_assign( tensor: TchTensor, dim: usize, indices: TchTensor, value: TchTensor, ) -> TchTensor
Assign the selected elements along the given dimension corresponding for the given indices
to the given value. Read more
Source§fn float_slice(tensor: TchTensor, slices: &[Slice]) -> TchTensor
fn float_slice(tensor: TchTensor, slices: &[Slice]) -> TchTensor
Select tensor elements corresponding to the given slices. Read more
Source§fn float_slice_assign(
tensor: TchTensor,
slices: &[Slice],
value: TchTensor,
) -> TchTensor
fn float_slice_assign( tensor: TchTensor, slices: &[Slice], value: TchTensor, ) -> TchTensor
Assign the selected elements corresponding to the given slices to the given value. Read more
Source§fn float_mask_where(
tensor: TchTensor,
mask: TchTensor,
value: TchTensor,
) -> TchTensor
fn float_mask_where( tensor: TchTensor, mask: TchTensor, value: TchTensor, ) -> TchTensor
Update the given tensor with the value tensor where the mask is true. Read more
Source§fn float_mask_fill(tensor: TchTensor, mask: TchTensor, value: E) -> TchTensor
fn float_mask_fill(tensor: TchTensor, mask: TchTensor, value: E) -> TchTensor
Update the given tensor with the value where the mask is true. Read more
Source§fn float_equal(lhs: TchTensor, rhs: TchTensor) -> TchTensor
fn float_equal(lhs: TchTensor, rhs: TchTensor) -> TchTensor
Equal comparison of two tensors. Read more
Source§fn float_equal_elem(lhs: TchTensor, rhs: E) -> TchTensor
fn float_equal_elem(lhs: TchTensor, rhs: E) -> TchTensor
Equal comparison of a tensor and a scalar. Read more
Source§fn float_greater(lhs: TchTensor, rhs: TchTensor) -> TchTensor
fn float_greater(lhs: TchTensor, rhs: TchTensor) -> TchTensor
Greater than comparison of two tensors. Read more
Source§fn float_greater_elem(lhs: TchTensor, rhs: E) -> TchTensor
fn float_greater_elem(lhs: TchTensor, rhs: E) -> TchTensor
Greater than comparison of a tensor and a scalar. Read more
Source§fn float_greater_equal(lhs: TchTensor, rhs: TchTensor) -> TchTensor
fn float_greater_equal(lhs: TchTensor, rhs: TchTensor) -> TchTensor
Greater than or equal comparison of two tensors. Read more
Source§fn float_greater_equal_elem(lhs: TchTensor, rhs: E) -> TchTensor
fn float_greater_equal_elem(lhs: TchTensor, rhs: E) -> TchTensor
Greater than or equal comparison of a tensor and a scalar. Read more
Source§fn float_lower(lhs: TchTensor, rhs: TchTensor) -> TchTensor
fn float_lower(lhs: TchTensor, rhs: TchTensor) -> TchTensor
Less than comparison of two tensors. Read more
Source§fn float_lower_elem(lhs: TchTensor, rhs: E) -> TchTensor
fn float_lower_elem(lhs: TchTensor, rhs: E) -> TchTensor
Less than comparison of a tensor and a scalar. Read more
Source§fn float_lower_equal(lhs: TchTensor, rhs: TchTensor) -> TchTensor
fn float_lower_equal(lhs: TchTensor, rhs: TchTensor) -> TchTensor
Less than or equal comparison of two tensors. Read more
Source§fn float_lower_equal_elem(lhs: TchTensor, rhs: E) -> TchTensor
fn float_lower_equal_elem(lhs: TchTensor, rhs: E) -> TchTensor
Less than or equal comparison of a tensor and a scalar. Read more
Source§fn float_sum_dim(tensor: TchTensor, dim: usize) -> TchTensor
fn float_sum_dim(tensor: TchTensor, dim: usize) -> TchTensor
Sum of all elements in a tensor along a dimension. Read more
Source§fn float_mean_dim(tensor: TchTensor, dim: usize) -> TchTensor
fn float_mean_dim(tensor: TchTensor, dim: usize) -> TchTensor
Mean of all elements in a tensor along a dimension. Read more
Source§fn float_cumsum(tensor: TchTensor, dim: usize) -> TchTensor
fn float_cumsum(tensor: TchTensor, dim: usize) -> TchTensor
Computes the cumulative sum of elements along a dimension. Read more
Source§fn float_cumprod(tensor: TchTensor, dim: usize) -> TchTensor
fn float_cumprod(tensor: TchTensor, dim: usize) -> TchTensor
Computes the cumulative product of elements along a dimension. Read more
Source§fn float_cummin(tensor: TchTensor, dim: usize) -> TchTensor
fn float_cummin(tensor: TchTensor, dim: usize) -> TchTensor
Computes the cumulative minimum of elements along a dimension. Read more
Source§fn float_cummax(tensor: TchTensor, dim: usize) -> TchTensor
fn float_cummax(tensor: TchTensor, dim: usize) -> TchTensor
Computes the cumulative maximum of elements along a dimension. Read more
Source§fn float_prod_dim(tensor: TchTensor, dim: usize) -> TchTensor
fn float_prod_dim(tensor: TchTensor, dim: usize) -> TchTensor
Product of all elements in a tensor along a dimension. Read more
Source§fn float_argmax(tensor: TchTensor, dim: usize) -> TchTensor
fn float_argmax(tensor: TchTensor, dim: usize) -> TchTensor
Gets the indices of the maximum elements of a tensor along an axis. Read more
Source§fn float_argmin(tensor: TchTensor, dim: usize) -> TchTensor
fn float_argmin(tensor: TchTensor, dim: usize) -> TchTensor
Gets the indices of the minimum elements of a tensor along an axis. Read more
Source§fn float_max_dim(tensor: TchTensor, dim: usize) -> TchTensor
fn float_max_dim(tensor: TchTensor, dim: usize) -> TchTensor
Gets the maximum elements of a tensor along an axis. Read more
Source§fn float_max_dim_with_indices(
tensor: TchTensor,
dim: usize,
) -> (TchTensor, TchTensor)
fn float_max_dim_with_indices( tensor: TchTensor, dim: usize, ) -> (TchTensor, TchTensor)
Gets the maximum elements of a tensor along an axis and their indices. Read more
Source§fn float_min_dim(tensor: TchTensor, dim: usize) -> TchTensor
fn float_min_dim(tensor: TchTensor, dim: usize) -> TchTensor
Gets the minimum elements of a tensor along an axis. Read more
Source§fn float_min_dim_with_indices(
tensor: TchTensor,
dim: usize,
) -> (TchTensor, TchTensor)
fn float_min_dim_with_indices( tensor: TchTensor, dim: usize, ) -> (TchTensor, TchTensor)
Gets the minimum elements of a tensor along an axis and their indices. Read more
Source§fn float_exp(tensor: TchTensor) -> TchTensor
fn float_exp(tensor: TchTensor) -> TchTensor
Returns a new tensor with exponential values. Read more
Source§fn float_log(tensor: TchTensor) -> TchTensor
fn float_log(tensor: TchTensor) -> TchTensor
Returns a new tensor with natural logarithm values. Read more
Source§fn float_log1p(tensor: TchTensor) -> TchTensor
fn float_log1p(tensor: TchTensor) -> TchTensor
Returns a new tensor with logarithm values of (1 + Xi). Read more
Source§fn float_powf_scalar_impl(tensor: TchTensor, value: f32) -> TchTensor
fn float_powf_scalar_impl(tensor: TchTensor, value: f32) -> TchTensor
Returns a new tensor with values raised to the power of float
value. Read moreSource§fn float_sqrt(tensor: TchTensor) -> TchTensor
fn float_sqrt(tensor: TchTensor) -> TchTensor
Returns a new tensor with square root values. Read more
Source§fn float_abs(tensor: TchTensor) -> TchTensor
fn float_abs(tensor: TchTensor) -> TchTensor
Returns a new tensor with absolute values. Read more
Source§fn float_cos(tensor: TchTensor) -> TchTensor
fn float_cos(tensor: TchTensor) -> TchTensor
Returns a new tensor with cosine values. Read more
Source§fn float_tanh(tensor: TchTensor) -> TchTensor
fn float_tanh(tensor: TchTensor) -> TchTensor
Returns a new tensor with hyperbolic tangent values. Read more
Source§fn float_round(tensor: TchTensor) -> TchTensor
fn float_round(tensor: TchTensor) -> TchTensor
Returns a new tensor with rounded values. Read more
Source§fn float_floor(tensor: TchTensor) -> TchTensor
fn float_floor(tensor: TchTensor) -> TchTensor
Returns a new tensor with floored values. Read more
Source§fn float_ceil(tensor: TchTensor) -> TchTensor
fn float_ceil(tensor: TchTensor) -> TchTensor
Returns a new tensor with ceiled values. Read more
Source§fn float_trunc(tensor: TchTensor) -> TchTensor
fn float_trunc(tensor: TchTensor) -> TchTensor
Returns a new tensor with truncated values. Read more
Source§fn float_erf(tensor: TchTensor) -> TchTensor
fn float_erf(tensor: TchTensor) -> TchTensor
Returns a new tensor with the error function values. Read more
Source§fn float_cat(tensors: Vec<TchTensor>, dim: usize) -> TchTensor
fn float_cat(tensors: Vec<TchTensor>, dim: usize) -> TchTensor
Concatenates tensors along a dimension. Read more
Source§fn float_clamp_min(tensor: TchTensor, min: E) -> TchTensor
fn float_clamp_min(tensor: TchTensor, min: E) -> TchTensor
Clamps a tensor under a minimum value. Read more
Source§fn float_clamp_max(
tensor: TchTensor,
max: <LibTorch<E> as Backend>::FloatElem,
) -> TchTensor
fn float_clamp_max( tensor: TchTensor, max: <LibTorch<E> as Backend>::FloatElem, ) -> TchTensor
Clamps a tensor over a maximum value. Read more
Source§fn float_clamp(
tensor: TchTensor,
min: <LibTorch<E> as Backend>::FloatElem,
max: <LibTorch<E> as Backend>::FloatElem,
) -> TchTensor
fn float_clamp( tensor: TchTensor, min: <LibTorch<E> as Backend>::FloatElem, max: <LibTorch<E> as Backend>::FloatElem, ) -> TchTensor
Clamps a tensor between a minimum and maximum value. Read more
Source§fn float_into_int(tensor: TchTensor) -> TchTensor
fn float_into_int(tensor: TchTensor) -> TchTensor
Converts float tensor to int tensor. Read more
Source§fn float_powf(lhs: TchTensor, rhs: TchTensor) -> TchTensor
fn float_powf(lhs: TchTensor, rhs: TchTensor) -> TchTensor
Element-wise power with a FloatTensor. Read more
Source§fn float_permute(tensor: TchTensor, axes: &[usize]) -> TchTensor
fn float_permute(tensor: TchTensor, axes: &[usize]) -> TchTensor
Permutes the dimensions of a tensor. Read more
Source§fn float_flip(tensor: TchTensor, axes: &[usize]) -> TchTensor
fn float_flip(tensor: TchTensor, axes: &[usize]) -> TchTensor
Reverse the order of elements in a tensor along the given axes. Read more
Source§fn float_sign(tensor: TchTensor) -> TchTensor
fn float_sign(tensor: TchTensor) -> TchTensor
Returns the signs of the float
tensor. Read moreSource§fn float_expand(tensor: TchTensor, shape: Shape) -> TchTensor
fn float_expand(tensor: TchTensor, shape: Shape) -> TchTensor
Broadcasts the float
tensor to the given shape.Source§fn float_sort(tensor: TchTensor, dim: usize, descending: bool) -> TchTensor
fn float_sort(tensor: TchTensor, dim: usize, descending: bool) -> TchTensor
Sort the elements of the input
tensor by value in along a given dimension. Read moreSource§fn float_sort_with_indices(
tensor: TchTensor,
dim: usize,
descending: bool,
) -> (TchTensor, TchTensor)
fn float_sort_with_indices( tensor: TchTensor, dim: usize, descending: bool, ) -> (TchTensor, TchTensor)
Sort the elements of the input
tensor by value in along a given dimension. Read moreSource§fn float_argsort(
tensor: TchTensor,
dim: usize,
descending: bool,
) -> IntTensor<Self>
fn float_argsort( tensor: TchTensor, dim: usize, descending: bool, ) -> IntTensor<Self>
Returns the indices that sort the elements of the input
tensor by value along a given dimension. Read moreSource§fn float_cast(tensor: TchTensor, dtype: FloatDType) -> TchTensor
fn float_cast(tensor: TchTensor, dtype: FloatDType) -> TchTensor
Converts a tensor to another floating point data type. Read more
Source§fn float_unfold(
tensor: FloatTensor<Self>,
dim: usize,
size: usize,
step: usize,
) -> FloatTensor<Self>
fn float_unfold( tensor: FloatTensor<Self>, dim: usize, size: usize, step: usize, ) -> FloatTensor<Self>
Unfold windows along a dimension. Read more
Source§fn float_is_nan(tensor: FloatTensor<Self>) -> BoolTensor<Self>
fn float_is_nan(tensor: FloatTensor<Self>) -> BoolTensor<Self>
Returns a new tensor with boolean elements indicating whether each element of the input is NaN. Read more
Source§fn float_is_inf(tensor: FloatTensor<Self>) -> BoolTensor<Self>
fn float_is_inf(tensor: FloatTensor<Self>) -> BoolTensor<Self>
Returns a new tensor with boolean elements indicating whether each element of the input is infinite (either +INF or -INF). Read more
Source§fn float_full(
shape: Shape,
fill_value: <B as Backend>::FloatElem,
device: &<B as Backend>::Device,
dtype: FloatDType,
) -> <B as Backend>::FloatTensorPrimitive
fn float_full( shape: Shape, fill_value: <B as Backend>::FloatElem, device: &<B as Backend>::Device, dtype: FloatDType, ) -> <B as Backend>::FloatTensorPrimitive
Creates a tensor filled with given value. Read more
Source§fn float_transpose(
tensor: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn float_transpose( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
Transposes a tensor. Read more
Source§fn float_not_equal(
lhs: <B as Backend>::FloatTensorPrimitive,
rhs: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn float_not_equal( lhs: <B as Backend>::FloatTensorPrimitive, rhs: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
Element-wise non-equality comparison. Read more
Source§fn float_not_equal_elem(
lhs: <B as Backend>::FloatTensorPrimitive,
rhs: <B as Backend>::FloatElem,
) -> <B as Backend>::BoolTensorPrimitive
fn float_not_equal_elem( lhs: <B as Backend>::FloatTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> <B as Backend>::BoolTensorPrimitive
Element-wise non-equality comparison with a scalar. Read more
Source§fn float_detach(
tensor: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn float_detach( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
Detaches a tensor from the computation graph.
Source§fn float_set_require_grad(
tensor: <B as Backend>::FloatTensorPrimitive,
_require_grad: bool,
) -> <B as Backend>::FloatTensorPrimitive
fn float_set_require_grad( tensor: <B as Backend>::FloatTensorPrimitive, _require_grad: bool, ) -> <B as Backend>::FloatTensorPrimitive
Sets the
require_grad flag of a tensor.Source§fn float_is_require_grad(_tensor: &<B as Backend>::FloatTensorPrimitive) -> bool
fn float_is_require_grad(_tensor: &<B as Backend>::FloatTensorPrimitive) -> bool
Returns the
require_grad flag of a tensor.Source§fn float_powi(
lhs: <B as Backend>::FloatTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn float_powi( lhs: <B as Backend>::FloatTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
Element-wise power with an IntTensor. Read more
Source§fn float_powi_scalar(
lhs: <B as Backend>::FloatTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::FloatTensorPrimitive
fn float_powi_scalar( lhs: <B as Backend>::FloatTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::FloatTensorPrimitive
Raises a tensor to the power of an int scalar. Read more
Source§fn float_powi_scalar_impl(
lhs: <B as Backend>::FloatTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::FloatTensorPrimitive
fn float_powi_scalar_impl( lhs: <B as Backend>::FloatTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::FloatTensorPrimitive
Raises a tensor to the power of an int scalar. Read more
Source§fn float_powf_scalar(
tensor: <B as Backend>::FloatTensorPrimitive,
value: f32,
) -> <B as Backend>::FloatTensorPrimitive
fn float_powf_scalar( tensor: <B as Backend>::FloatTensorPrimitive, value: f32, ) -> <B as Backend>::FloatTensorPrimitive
Returns a new tensor with values raised to the power of float
value. Read moreSource§fn float_tan(
tensor: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn float_tan( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
Returns a new tensor with tangent values. Read more
Source§fn float_cosh(
tensor: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn float_cosh( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
Returns a new tensor with hyperbolic cosine values. Read more
Source§fn float_sinh(
tensor: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn float_sinh( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
Returns a new tensor with hyperbolic sine values. Read more
Source§fn float_max(
tensor: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn float_max( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
Gets the maximum element of a tensor. Read more
Source§fn float_min(
tensor: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn float_min( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
Gets the minimum element of a tensor. Read more
Source§fn float_max_abs(
tensor: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn float_max_abs( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
Gets the maximum absolute element of a tensor. Read more
Source§fn float_max_abs_dim(
tensor: <B as Backend>::FloatTensorPrimitive,
dim: usize,
) -> <B as Backend>::FloatTensorPrimitive
fn float_max_abs_dim( tensor: <B as Backend>::FloatTensorPrimitive, dim: usize, ) -> <B as Backend>::FloatTensorPrimitive
Gets the maximum absolute elements of a tensor along an axis. Read more
Source§fn float_any(
tensor: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn float_any( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
Tests if any element in the float
tensor evaluates to True. Read moreSource§fn float_any_dim(
tensor: <B as Backend>::FloatTensorPrimitive,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive
fn float_any_dim( tensor: <B as Backend>::FloatTensorPrimitive, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive
Source§fn float_all(
tensor: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn float_all( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
Tests if all elements in the float
tensor evaluate to True. Read moreSource§fn float_all_dim(
tensor: <B as Backend>::FloatTensorPrimitive,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive
fn float_all_dim( tensor: <B as Backend>::FloatTensorPrimitive, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive
Source§fn float_grid_sample_2d(
tensor: <B as Backend>::FloatTensorPrimitive,
grid: <B as Backend>::FloatTensorPrimitive,
method: InterpolateMode,
) -> <B as Backend>::FloatTensorPrimitive
fn float_grid_sample_2d( tensor: <B as Backend>::FloatTensorPrimitive, grid: <B as Backend>::FloatTensorPrimitive, method: InterpolateMode, ) -> <B as Backend>::FloatTensorPrimitive
Samples tensor as a two-dimensional spatial grid of (possibly multi-channel) values,
using the given locations in [-1, 1]. Read more
Source§impl<E: TchElement> IntTensorOps<LibTorch<E>> for LibTorch<E>
impl<E: TchElement> IntTensorOps<LibTorch<E>> for LibTorch<E>
Source§fn int_from_data(data: TensorData, device: &LibTorchDevice) -> TchTensor
fn int_from_data(data: TensorData, device: &LibTorchDevice) -> TchTensor
Creates a tensor from the data structure. Read more
Source§fn int_repeat_dim(tensor: TchTensor, dim: usize, times: usize) -> TchTensor
fn int_repeat_dim(tensor: TchTensor, dim: usize, times: usize) -> TchTensor
Repeats the tensor along the given dimension the given number of times. Read more
Source§async fn int_into_data(tensor: TchTensor) -> TensorData
async fn int_into_data(tensor: TchTensor) -> TensorData
Converts the tensor to a data structure. Read more
Source§fn int_to_device(tensor: TchTensor, device: &LibTorchDevice) -> TchTensor
fn int_to_device(tensor: TchTensor, device: &LibTorchDevice) -> TchTensor
Moves the tensor to the given device.
Source§fn int_device(tensor: &TchTensor) -> LibTorchDevice
fn int_device(tensor: &TchTensor) -> LibTorchDevice
Gets the device of the tensor. Read more
Source§fn int_empty(
shape: Shape,
device: &<LibTorch<E> as Backend>::Device,
dtype: IntDType,
) -> TchTensor
fn int_empty( shape: Shape, device: &<LibTorch<E> as Backend>::Device, dtype: IntDType, ) -> TchTensor
Creates a new int tensor. Read more
Source§fn int_slice(tensor: TchTensor, slices: &[Slice]) -> TchTensor
fn int_slice(tensor: TchTensor, slices: &[Slice]) -> TchTensor
Gets the element at the given indices. Read more
Source§fn int_slice_assign(
tensor: TchTensor,
slices: &[Slice],
value: TchTensor,
) -> TchTensor
fn int_slice_assign( tensor: TchTensor, slices: &[Slice], value: TchTensor, ) -> TchTensor
Sets the values in the tensor for the given ranges. Read more
Source§fn int_cat(tensors: Vec<TchTensor>, dim: usize) -> TchTensor
fn int_cat(tensors: Vec<TchTensor>, dim: usize) -> TchTensor
Concatenates the given tensors along the given dimension. Read more
Source§fn int_matmul(lhs: IntTensor<Self>, rhs: IntTensor<Self>) -> IntTensor<Self>
fn int_matmul(lhs: IntTensor<Self>, rhs: IntTensor<Self>) -> IntTensor<Self>
Multiplies two tensors together using matrix multiplication. Read more
Source§fn int_equal(lhs: TchTensor, rhs: TchTensor) -> TchTensor
fn int_equal(lhs: TchTensor, rhs: TchTensor) -> TchTensor
Element-wise equality comparison. Read more
Source§fn int_equal_elem(lhs: TchTensor, rhs: i64) -> TchTensor
fn int_equal_elem(lhs: TchTensor, rhs: i64) -> TchTensor
Element-wise equality comparison with a scalar. Read more
Source§fn int_greater(lhs: TchTensor, rhs: TchTensor) -> TchTensor
fn int_greater(lhs: TchTensor, rhs: TchTensor) -> TchTensor
Element-wise greater than comparison. Read more
Source§fn int_greater_elem(lhs: TchTensor, rhs: i64) -> TchTensor
fn int_greater_elem(lhs: TchTensor, rhs: i64) -> TchTensor
Element-wise greater than comparison with a scalar. Read more
Source§fn int_greater_equal(lhs: TchTensor, rhs: TchTensor) -> TchTensor
fn int_greater_equal(lhs: TchTensor, rhs: TchTensor) -> TchTensor
Element-wise greater than or equal comparison. Read more
Source§fn int_greater_equal_elem(lhs: TchTensor, rhs: i64) -> TchTensor
fn int_greater_equal_elem(lhs: TchTensor, rhs: i64) -> TchTensor
Element-wise greater than or equal comparison with a scalar. Read more
Source§fn int_lower(lhs: TchTensor, rhs: TchTensor) -> TchTensor
fn int_lower(lhs: TchTensor, rhs: TchTensor) -> TchTensor
Element-wise less than comparison. Read more
Source§fn int_lower_elem(lhs: TchTensor, rhs: i64) -> TchTensor
fn int_lower_elem(lhs: TchTensor, rhs: i64) -> TchTensor
Element-wise less than comparison with a scalar. Read more
Source§fn int_lower_equal(lhs: TchTensor, rhs: TchTensor) -> TchTensor
fn int_lower_equal(lhs: TchTensor, rhs: TchTensor) -> TchTensor
Element-wise less than or equal comparison. Read more
Source§fn int_lower_equal_elem(lhs: TchTensor, rhs: i64) -> TchTensor
fn int_lower_equal_elem(lhs: TchTensor, rhs: i64) -> TchTensor
Element-wise less than or equal comparison with a scalar. Read more
Source§fn int_add_scalar(lhs: TchTensor, rhs: i64) -> TchTensor
fn int_add_scalar(lhs: TchTensor, rhs: i64) -> TchTensor
Element-wise addition with a scalar. Read more
Source§fn int_sub_scalar(lhs: TchTensor, rhs: i64) -> TchTensor
fn int_sub_scalar(lhs: TchTensor, rhs: i64) -> TchTensor
Element-wise subtraction with a scalar. Read more
Source§fn int_mul(lhs: TchTensor, rhs: TchTensor) -> TchTensor
fn int_mul(lhs: TchTensor, rhs: TchTensor) -> TchTensor
Element-wise multiplication. Read more
Source§fn int_mul_scalar(lhs: TchTensor, rhs: i64) -> TchTensor
fn int_mul_scalar(lhs: TchTensor, rhs: i64) -> TchTensor
Element-wise multiplication with a scalar. Read more
Source§fn int_div_scalar(lhs: TchTensor, rhs: i64) -> TchTensor
fn int_div_scalar(lhs: TchTensor, rhs: i64) -> TchTensor
Element-wise division with a scalar. Read more
Source§fn int_remainder_scalar(lhs: TchTensor, rhs: i64) -> TchTensor
fn int_remainder_scalar(lhs: TchTensor, rhs: i64) -> TchTensor
Element-wise modulus with a scalar. Read more
Source§fn int_zeros(
shape: Shape,
device: &<LibTorch<E> as Backend>::Device,
dtype: IntDType,
) -> TchTensor
fn int_zeros( shape: Shape, device: &<LibTorch<E> as Backend>::Device, dtype: IntDType, ) -> TchTensor
Creates a tensor of zeros. Read more
Source§fn int_ones(
shape: Shape,
device: &<LibTorch<E> as Backend>::Device,
dtype: IntDType,
) -> TchTensor
fn int_ones( shape: Shape, device: &<LibTorch<E> as Backend>::Device, dtype: IntDType, ) -> TchTensor
Creates a tensor of ones. Read more
Source§fn int_full(
shape: Shape,
fill_value: i64,
device: &<LibTorch<E> as Backend>::Device,
dtype: IntDType,
) -> TchTensor
fn int_full( shape: Shape, fill_value: i64, device: &<LibTorch<E> as Backend>::Device, dtype: IntDType, ) -> TchTensor
Creates a tensor filled with given value. Read more
Source§fn int_sum_dim(tensor: TchTensor, dim: usize) -> TchTensor
fn int_sum_dim(tensor: TchTensor, dim: usize) -> TchTensor
Sums all elements in the tensor along a dimension. Read more
Source§fn int_prod(tensor: TchTensor) -> TchTensor
fn int_prod(tensor: TchTensor) -> TchTensor
Computes the product of all elements in the tensor. Read more
Source§fn int_prod_dim(tensor: TchTensor, dim: usize) -> TchTensor
fn int_prod_dim(tensor: TchTensor, dim: usize) -> TchTensor
Computes the product of all elements in the tensor along a dimension. Read more
Source§fn int_mean(tensor: TchTensor) -> TchTensor
fn int_mean(tensor: TchTensor) -> TchTensor
Computes the mean of all elements in the tensor. Read more
Source§fn int_mean_dim(tensor: TchTensor, dim: usize) -> TchTensor
fn int_mean_dim(tensor: TchTensor, dim: usize) -> TchTensor
Computes the mean of all elements in the tensor along a dimension. Read more
Source§fn int_cumsum(tensor: TchTensor, dim: usize) -> TchTensor
fn int_cumsum(tensor: TchTensor, dim: usize) -> TchTensor
Computes the cumulative sum of elements along a dimension. Read more
Source§fn int_cumprod(tensor: TchTensor, dim: usize) -> TchTensor
fn int_cumprod(tensor: TchTensor, dim: usize) -> TchTensor
Computes the cumulative product of elements along a dimension. Read more
Source§fn int_cummin(tensor: TchTensor, dim: usize) -> TchTensor
fn int_cummin(tensor: TchTensor, dim: usize) -> TchTensor
Computes the cumulative minimum of elements along a dimension. Read more
Source§fn int_cummax(tensor: TchTensor, dim: usize) -> TchTensor
fn int_cummax(tensor: TchTensor, dim: usize) -> TchTensor
Computes the cumulative maximum of elements along a dimension. Read more
Source§fn int_gather(dim: usize, tensor: TchTensor, indices: TchTensor) -> TchTensor
fn int_gather(dim: usize, tensor: TchTensor, indices: TchTensor) -> TchTensor
Gather elements from the tensor at the given indices. Read more
Source§fn int_scatter(
dim: usize,
tensor: TchTensor,
indices: TchTensor,
value: TchTensor,
) -> TchTensor
fn int_scatter( dim: usize, tensor: TchTensor, indices: TchTensor, value: TchTensor, ) -> TchTensor
Scatter a given value to the tensor at the given indices. Read more
Source§fn int_select(tensor: TchTensor, dim: usize, indices: TchTensor) -> TchTensor
fn int_select(tensor: TchTensor, dim: usize, indices: TchTensor) -> TchTensor
Select tensor elements along the given dimension corresponding to the given indices. Read more
Source§fn int_select_assign(
tensor: TchTensor,
dim: usize,
indices: TchTensor,
value: TchTensor,
) -> TchTensor
fn int_select_assign( tensor: TchTensor, dim: usize, indices: TchTensor, value: TchTensor, ) -> TchTensor
Assign the selected elements along the given dimension corresponding to the given indices
to the given value. Read more
Source§fn int_mask_where(
tensor: TchTensor,
mask: TchTensor,
source: TchTensor,
) -> TchTensor
fn int_mask_where( tensor: TchTensor, mask: TchTensor, source: TchTensor, ) -> TchTensor
Fills the tensor with values from the source tensor if the mask is true at the given
indices. Read more
Source§fn int_mask_fill(tensor: TchTensor, mask: TchTensor, value: i64) -> TchTensor
fn int_mask_fill(tensor: TchTensor, mask: TchTensor, value: i64) -> TchTensor
Fills the tensor with the given value if the mask is true at the given indices. Read more
Source§fn int_argmax(tensor: TchTensor, dim: usize) -> TchTensor
fn int_argmax(tensor: TchTensor, dim: usize) -> TchTensor
Gets the indices of the maximum elements along a dimension. Read more
Source§fn int_argmin(tensor: TchTensor, dim: usize) -> TchTensor
fn int_argmin(tensor: TchTensor, dim: usize) -> TchTensor
Gets the indices of the minimum elements along a dimension. Read more
Source§fn int_max_dim(tensor: TchTensor, dim: usize) -> TchTensor
fn int_max_dim(tensor: TchTensor, dim: usize) -> TchTensor
Gets the maximum element in the tensor along a dimension. Read more
Source§fn int_max_dim_with_indices(
tensor: TchTensor,
dim: usize,
) -> (TchTensor, TchTensor)
fn int_max_dim_with_indices( tensor: TchTensor, dim: usize, ) -> (TchTensor, TchTensor)
Gets the maximum elements and corresponding indices along a dimension. Read more
Source§fn int_min_dim(tensor: TchTensor, dim: usize) -> TchTensor
fn int_min_dim(tensor: TchTensor, dim: usize) -> TchTensor
Gets the minimum elements in the tensor along a dimension. Read more
Source§fn int_min_dim_with_indices(
tensor: TchTensor,
dim: usize,
) -> (TchTensor, TchTensor)
fn int_min_dim_with_indices( tensor: TchTensor, dim: usize, ) -> (TchTensor, TchTensor)
Gets the minimum elements and corresponding indices along a dimension. Read more
Source§fn int_clamp_min(tensor: TchTensor, min: i64) -> TchTensor
fn int_clamp_min(tensor: TchTensor, min: i64) -> TchTensor
Clamps a tensor under a minimum value. Read more
Source§fn int_clamp_max(tensor: TchTensor, max: i64) -> TchTensor
fn int_clamp_max(tensor: TchTensor, max: i64) -> TchTensor
Clamps a tensor over a maximum value. Read more
Source§fn int_clamp(tensor: TchTensor, min: i64, max: i64) -> TchTensor
fn int_clamp(tensor: TchTensor, min: i64, max: i64) -> TchTensor
Clamps a tensor between a minimum and maximum value. Read more
Source§fn int_abs(tensor: TchTensor) -> TchTensor
fn int_abs(tensor: TchTensor) -> TchTensor
Returns a new tensor with absolute values. Read more
Source§fn int_into_float(tensor: TchTensor) -> TchTensor
fn int_into_float(tensor: TchTensor) -> TchTensor
Converts int tensor to float tensor. Read more
Source§fn int_swap_dims(
tensor: IntTensor<Self>,
dim1: usize,
dim2: usize,
) -> IntTensor<Self>
fn int_swap_dims( tensor: IntTensor<Self>, dim1: usize, dim2: usize, ) -> IntTensor<Self>
Swaps two dimensions of an int tensor. Read more
Source§fn int_random(
shape: Shape,
distribution: Distribution,
device: &LibTorchDevice,
) -> TchTensor
fn int_random( shape: Shape, distribution: Distribution, device: &LibTorchDevice, ) -> TchTensor
Creates a new int tensor with random values. Read more
Source§fn int_arange(range: Range<i64>, device: &LibTorchDevice) -> TchTensor
fn int_arange(range: Range<i64>, device: &LibTorchDevice) -> TchTensor
Creates a new tensor with values from the given range. Read more
Source§fn int_permute(tensor: IntTensor<Self>, axes: &[usize]) -> IntTensor<Self>
fn int_permute(tensor: IntTensor<Self>, axes: &[usize]) -> IntTensor<Self>
Permutes the dimensions of a tensor. Read more
Source§fn int_flip(tensor: IntTensor<Self>, axes: &[usize]) -> IntTensor<Self>
fn int_flip(tensor: IntTensor<Self>, axes: &[usize]) -> IntTensor<Self>
Reverse the order of elements in a tensor along the given axes. Read more
Source§fn int_sign(tensor: IntTensor<Self>) -> IntTensor<Self>
fn int_sign(tensor: IntTensor<Self>) -> IntTensor<Self>
Returns the signs of the int
tensor. Read moreSource§fn int_expand(tensor: IntTensor<Self>, shape: Shape) -> IntTensor<Self>
fn int_expand(tensor: IntTensor<Self>, shape: Shape) -> IntTensor<Self>
Broadcasts the int
tensor to the given shape.Source§fn int_sort(
tensor: IntTensor<Self>,
dim: usize,
descending: bool,
) -> IntTensor<Self>
fn int_sort( tensor: IntTensor<Self>, dim: usize, descending: bool, ) -> IntTensor<Self>
Sort the elements of the input
tensor by value along a given dimension. Read moreSource§fn int_argsort(
tensor: IntTensor<Self>,
dim: usize,
descending: bool,
) -> IntTensor<Self>
fn int_argsort( tensor: IntTensor<Self>, dim: usize, descending: bool, ) -> IntTensor<Self>
Returns the indices that sort the elements of the input
tensor by value
along a given dimension. Read moreSource§fn bitwise_and(lhs: IntTensor<Self>, rhs: IntTensor<Self>) -> IntTensor<Self>
fn bitwise_and(lhs: IntTensor<Self>, rhs: IntTensor<Self>) -> IntTensor<Self>
Bitwise AND operation for Int Tensors
Source§fn bitwise_or(lhs: IntTensor<Self>, rhs: IntTensor<Self>) -> IntTensor<Self>
fn bitwise_or(lhs: IntTensor<Self>, rhs: IntTensor<Self>) -> IntTensor<Self>
Bitwise OR operation for Int Tensors
Source§fn bitwise_xor(lhs: IntTensor<Self>, rhs: IntTensor<Self>) -> IntTensor<Self>
fn bitwise_xor(lhs: IntTensor<Self>, rhs: IntTensor<Self>) -> IntTensor<Self>
Bitwise XOR operation for Int Tensors
Source§fn bitwise_not(tensor: IntTensor<Self>) -> IntTensor<Self>
fn bitwise_not(tensor: IntTensor<Self>) -> IntTensor<Self>
Bitwise NOT operation for Int Tensors
Source§fn bitwise_and_scalar(
lhs: IntTensor<Self>,
rhs: IntElem<Self>,
) -> IntTensor<Self>
fn bitwise_and_scalar( lhs: IntTensor<Self>, rhs: IntElem<Self>, ) -> IntTensor<Self>
Bitwise AND operation for Int Tensors with a scalar
Source§fn bitwise_or_scalar(
lhs: IntTensor<Self>,
rhs: IntElem<Self>,
) -> IntTensor<Self>
fn bitwise_or_scalar( lhs: IntTensor<Self>, rhs: IntElem<Self>, ) -> IntTensor<Self>
Bitwise OR operation for Int Tensors with a scalar
Source§fn bitwise_xor_scalar(
lhs: IntTensor<Self>,
rhs: IntElem<Self>,
) -> IntTensor<Self>
fn bitwise_xor_scalar( lhs: IntTensor<Self>, rhs: IntElem<Self>, ) -> IntTensor<Self>
Bitwise XOR operation for Int Tensors with a scalar
Source§fn bitwise_left_shift(
lhs: IntTensor<Self>,
rhs: IntTensor<Self>,
) -> IntTensor<Self>
fn bitwise_left_shift( lhs: IntTensor<Self>, rhs: IntTensor<Self>, ) -> IntTensor<Self>
Bitwise left shift operation for Int Tensors
Source§fn bitwise_right_shift(
lhs: IntTensor<Self>,
rhs: IntTensor<Self>,
) -> IntTensor<Self>
fn bitwise_right_shift( lhs: IntTensor<Self>, rhs: IntTensor<Self>, ) -> IntTensor<Self>
Bitwise right shift operation for Int Tensors
Source§fn bitwise_left_shift_scalar(
lhs: IntTensor<Self>,
rhs: IntElem<Self>,
) -> IntTensor<Self>
fn bitwise_left_shift_scalar( lhs: IntTensor<Self>, rhs: IntElem<Self>, ) -> IntTensor<Self>
Bitwise left shift operation for Int Tensors with a scalar
Source§fn bitwise_right_shift_scalar(
lhs: IntTensor<Self>,
rhs: IntElem<Self>,
) -> IntTensor<Self>
fn bitwise_right_shift_scalar( lhs: IntTensor<Self>, rhs: IntElem<Self>, ) -> IntTensor<Self>
Bitwise right shift operation for Int Tensors with a scalar
Source§fn int_cast(tensor: IntTensor<Self>, dtype: IntDType) -> IntTensor<Self>
fn int_cast(tensor: IntTensor<Self>, dtype: IntDType) -> IntTensor<Self>
Converts a tensor to another integer data type. Read more
Source§fn int_unfold(
tensor: IntTensor<Self>,
dim: usize,
size: usize,
step: usize,
) -> IntTensor<Self>
fn int_unfold( tensor: IntTensor<Self>, dim: usize, size: usize, step: usize, ) -> IntTensor<Self>
Unfold windows along a dimension. Read more
Source§fn int_not_equal(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn int_not_equal( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
Element-wise non-equality comparison. Read more
Source§fn int_not_equal_elem(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::BoolTensorPrimitive
fn int_not_equal_elem( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::BoolTensorPrimitive
Element-wise non-equality comparison with a scalar. Read more
Source§fn int_powi(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_powi( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
Element-wise power with a IntTensor. Read more
Source§fn int_powf(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_powf( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
Element-wise power with a floatTensor. Read more
Source§fn int_powi_scalar(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive
fn int_powi_scalar( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::IntTensorPrimitive
Element-wise power with a scalar. Read more
Source§fn int_powi_scalar_impl(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive
fn int_powi_scalar_impl( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::IntTensorPrimitive
Element-wise power with a scalar. Read more
Source§fn int_powf_scalar(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: f32,
) -> <B as Backend>::IntTensorPrimitive
fn int_powf_scalar( lhs: <B as Backend>::IntTensorPrimitive, rhs: f32, ) -> <B as Backend>::IntTensorPrimitive
Element-wise power with a floatTensor. Read more
Source§fn int_powf_scalar_impl(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: f32,
) -> <B as Backend>::IntTensorPrimitive
fn int_powf_scalar_impl( lhs: <B as Backend>::IntTensorPrimitive, rhs: f32, ) -> <B as Backend>::IntTensorPrimitive
Element-wise power with a floatTensor. Read more
Source§fn int_max(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_max( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
Gets the maximum element in the tensor. Read more
Source§fn int_max_abs(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_max_abs( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
Gets the maximum absolute element in the tensor. Read more
Source§fn int_max_abs_dim(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> <B as Backend>::IntTensorPrimitive
fn int_max_abs_dim( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> <B as Backend>::IntTensorPrimitive
Gets the maximum absolute element in the tensor along a dimension. Read more
Source§fn int_min(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_min( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
Gets the minimum element in the tensor. Read more
Source§fn int_transpose(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_transpose( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
Transposes an int tensor. Read more
Source§fn int_arange_step(
range: Range<i64>,
step: usize,
device: &<B as Backend>::Device,
) -> <B as Backend>::IntTensorPrimitive
fn int_arange_step( range: Range<i64>, step: usize, device: &<B as Backend>::Device, ) -> <B as Backend>::IntTensorPrimitive
Creates a new tensor with values from the given range with the given step size. Read more
Source§fn int_any(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn int_any( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
Tests if any element in the int
tensor evaluates to True. Read moreSource§fn int_any_dim(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive
fn int_any_dim( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive
Source§fn int_all(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn int_all( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
Tests if all elements in the int
tensor evaluate to True. Read moreSource§fn int_all_dim(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive
fn int_all_dim( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive
Source§fn int_sort_with_indices(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
descending: bool,
) -> (<B as Backend>::IntTensorPrimitive, <B as Backend>::IntTensorPrimitive)
fn int_sort_with_indices( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, descending: bool, ) -> (<B as Backend>::IntTensorPrimitive, <B as Backend>::IntTensorPrimitive)
Sort the elements of the input
tensor by value along a given dimension. Read moreSource§impl<E: TchElement> ModuleOps<LibTorch<E>> for LibTorch<E>
impl<E: TchElement> ModuleOps<LibTorch<E>> for LibTorch<E>
Source§fn embedding(weights: TchTensor, indices: TchTensor) -> TchTensor
fn embedding(weights: TchTensor, indices: TchTensor) -> TchTensor
Embedding operation. Read more
Source§fn embedding_backward(
weights: TchTensor,
output: TchTensor,
indices: TchTensor,
) -> TchTensor
fn embedding_backward( weights: TchTensor, output: TchTensor, indices: TchTensor, ) -> TchTensor
Embedding backward operation. Read more
Source§fn conv1d(
x: TchTensor,
weight: TchTensor,
bias: Option<TchTensor>,
options: ConvOptions<1>,
) -> TchTensor
fn conv1d( x: TchTensor, weight: TchTensor, bias: Option<TchTensor>, options: ConvOptions<1>, ) -> TchTensor
One dimensional convolution. Read more
Source§fn conv2d(
x: TchTensor,
weight: TchTensor,
bias: Option<TchTensor>,
options: ConvOptions<2>,
) -> TchTensor
fn conv2d( x: TchTensor, weight: TchTensor, bias: Option<TchTensor>, options: ConvOptions<2>, ) -> TchTensor
Two dimensional convolution. Read more
Source§fn conv3d(
x: TchTensor,
weight: TchTensor,
bias: Option<TchTensor>,
options: ConvOptions<3>,
) -> TchTensor
fn conv3d( x: TchTensor, weight: TchTensor, bias: Option<TchTensor>, options: ConvOptions<3>, ) -> TchTensor
Three dimensional convolution. Read more
Source§fn deform_conv2d(
_x: TchTensor,
_offset: TchTensor,
_weight: TchTensor,
_mask: Option<TchTensor>,
_bias: Option<TchTensor>,
_options: DeformConvOptions<2>,
) -> TchTensor
fn deform_conv2d( _x: TchTensor, _offset: TchTensor, _weight: TchTensor, _mask: Option<TchTensor>, _bias: Option<TchTensor>, _options: DeformConvOptions<2>, ) -> TchTensor
Two dimensional deformable convolution. Read more
Source§fn deform_conv2d_backward(
_x: TchTensor,
_offset: TchTensor,
_weight: TchTensor,
_mask: Option<TchTensor>,
_bias: Option<TchTensor>,
_out_grad: TchTensor,
_options: DeformConvOptions<2>,
) -> DeformConv2dBackward<Self>
fn deform_conv2d_backward( _x: TchTensor, _offset: TchTensor, _weight: TchTensor, _mask: Option<TchTensor>, _bias: Option<TchTensor>, _out_grad: TchTensor, _options: DeformConvOptions<2>, ) -> DeformConv2dBackward<Self>
Backward pass for the deform_conv2d operation.
Source§fn conv_transpose1d(
x: TchTensor,
weight: TchTensor,
bias: Option<TchTensor>,
options: ConvTransposeOptions<1>,
) -> TchTensor
fn conv_transpose1d( x: TchTensor, weight: TchTensor, bias: Option<TchTensor>, options: ConvTransposeOptions<1>, ) -> TchTensor
One dimensional transposed convolution. Read more
Source§fn conv_transpose2d(
x: TchTensor,
weight: TchTensor,
bias: Option<TchTensor>,
options: ConvTransposeOptions<2>,
) -> TchTensor
fn conv_transpose2d( x: TchTensor, weight: TchTensor, bias: Option<TchTensor>, options: ConvTransposeOptions<2>, ) -> TchTensor
Two dimensional transposed convolution. Read more
Source§fn conv_transpose3d(
x: TchTensor,
weight: TchTensor,
bias: Option<TchTensor>,
options: ConvTransposeOptions<3>,
) -> TchTensor
fn conv_transpose3d( x: TchTensor, weight: TchTensor, bias: Option<TchTensor>, options: ConvTransposeOptions<3>, ) -> TchTensor
Three dimensional transposed convolution. Read more
Source§fn avg_pool1d(
x: TchTensor,
kernel_size: usize,
stride: usize,
padding: usize,
count_include_pad: bool,
) -> TchTensor
fn avg_pool1d( x: TchTensor, kernel_size: usize, stride: usize, padding: usize, count_include_pad: bool, ) -> TchTensor
One dimensional avg pooling. Read more
Source§fn avg_pool2d(
x: TchTensor,
kernel_size: [usize; 2],
stride: [usize; 2],
padding: [usize; 2],
count_include_pad: bool,
) -> TchTensor
fn avg_pool2d( x: TchTensor, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], count_include_pad: bool, ) -> TchTensor
Two dimensional avg pooling. Read more
Source§fn avg_pool2d_backward(
x: TchTensor,
grad: TchTensor,
kernel_size: [usize; 2],
stride: [usize; 2],
padding: [usize; 2],
count_include_pad: bool,
) -> TchTensor
fn avg_pool2d_backward( x: TchTensor, grad: TchTensor, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], count_include_pad: bool, ) -> TchTensor
Backward pass for the avg pooling 2d operation.
Source§fn max_pool1d(
x: TchTensor,
kernel_size: usize,
stride: usize,
padding: usize,
dilation: usize,
) -> TchTensor
fn max_pool1d( x: TchTensor, kernel_size: usize, stride: usize, padding: usize, dilation: usize, ) -> TchTensor
One dimensional max pooling. Read more
Source§fn max_pool1d_with_indices(
x: TchTensor,
kernel_size: usize,
stride: usize,
padding: usize,
dilation: usize,
) -> MaxPool1dWithIndices<LibTorch<E>>
fn max_pool1d_with_indices( x: TchTensor, kernel_size: usize, stride: usize, padding: usize, dilation: usize, ) -> MaxPool1dWithIndices<LibTorch<E>>
One dimensional max pooling with indices. Read more
Source§fn max_pool2d(
x: TchTensor,
kernel_size: [usize; 2],
stride: [usize; 2],
padding: [usize; 2],
dilation: [usize; 2],
) -> TchTensor
fn max_pool2d( x: TchTensor, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], ) -> TchTensor
Two dimensional max pooling. Read more
Source§fn max_pool2d_with_indices(
x: TchTensor,
kernel_size: [usize; 2],
stride: [usize; 2],
padding: [usize; 2],
dilation: [usize; 2],
) -> MaxPool2dWithIndices<LibTorch<E>>
fn max_pool2d_with_indices( x: TchTensor, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], ) -> MaxPool2dWithIndices<LibTorch<E>>
Two dimensional max pooling with indices. Read more
Source§fn max_pool2d_with_indices_backward(
x: TchTensor,
kernel_size: [usize; 2],
stride: [usize; 2],
padding: [usize; 2],
dilation: [usize; 2],
output_grad: TchTensor,
indices: TchTensor,
) -> MaxPool2dBackward<LibTorch<E>>
fn max_pool2d_with_indices_backward( x: TchTensor, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], output_grad: TchTensor, indices: TchTensor, ) -> MaxPool2dBackward<LibTorch<E>>
Backward pass for the max pooling 2d operation.
Source§fn adaptive_avg_pool2d(x: TchTensor, output_size: [usize; 2]) -> TchTensor
fn adaptive_avg_pool2d(x: TchTensor, output_size: [usize; 2]) -> TchTensor
Two dimensional adaptive avg pooling. Read more
Source§fn adaptive_avg_pool2d_backward(x: TchTensor, grad: TchTensor) -> TchTensor
fn adaptive_avg_pool2d_backward(x: TchTensor, grad: TchTensor) -> TchTensor
Backward pass for the adaptive avg pooling 2d operation.
Source§fn adaptive_avg_pool1d(x: TchTensor, output_size: usize) -> TchTensor
fn adaptive_avg_pool1d(x: TchTensor, output_size: usize) -> TchTensor
One dimensional adaptive avg pooling. Read more
Source§fn interpolate(
x: TchTensor,
output_size: [usize; 2],
options: InterpolateOptions,
) -> TchTensor
fn interpolate( x: TchTensor, output_size: [usize; 2], options: InterpolateOptions, ) -> TchTensor
Down/up samples the input. Read more
Source§fn interpolate_backward(
x: TchTensor,
grad: TchTensor,
output_size: [usize; 2],
options: InterpolateOptions,
) -> TchTensor
fn interpolate_backward( x: TchTensor, grad: TchTensor, output_size: [usize; 2], options: InterpolateOptions, ) -> TchTensor
Backward pass for the interpolate operation.
Source§fn conv1d_x_backward(
x: <B as Backend>::FloatTensorPrimitive,
weight: <B as Backend>::FloatTensorPrimitive,
output_grad: <B as Backend>::FloatTensorPrimitive,
options: ConvOptions<1>,
) -> <B as Backend>::FloatTensorPrimitive
fn conv1d_x_backward( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvOptions<1>, ) -> <B as Backend>::FloatTensorPrimitive
Backward pass for the conv1d operation, returning the gradient for
x.Source§fn conv1d_weight_backward(
x: <B as Backend>::FloatTensorPrimitive,
weight: <B as Backend>::FloatTensorPrimitive,
output_grad: <B as Backend>::FloatTensorPrimitive,
options: ConvOptions<1>,
) -> <B as Backend>::FloatTensorPrimitive
fn conv1d_weight_backward( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvOptions<1>, ) -> <B as Backend>::FloatTensorPrimitive
Backward pass for the conv1d operation, returning the gradient for
weight.Source§fn conv1d_bias_backward(
x: <B as Backend>::FloatTensorPrimitive,
bias: <B as Backend>::FloatTensorPrimitive,
output_grad: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn conv1d_bias_backward( x: <B as Backend>::FloatTensorPrimitive, bias: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
Backward pass for the conv1d operation, returning the gradient for
bias.Source§fn conv2d_x_backward(
x: <B as Backend>::FloatTensorPrimitive,
weight: <B as Backend>::FloatTensorPrimitive,
output_grad: <B as Backend>::FloatTensorPrimitive,
options: ConvOptions<2>,
) -> <B as Backend>::FloatTensorPrimitive
fn conv2d_x_backward( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvOptions<2>, ) -> <B as Backend>::FloatTensorPrimitive
Backward pass for the conv2d operation, returning the gradient for
x.Source§fn conv2d_weight_backward(
x: <B as Backend>::FloatTensorPrimitive,
weight: <B as Backend>::FloatTensorPrimitive,
output_grad: <B as Backend>::FloatTensorPrimitive,
options: ConvOptions<2>,
) -> <B as Backend>::FloatTensorPrimitive
fn conv2d_weight_backward( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvOptions<2>, ) -> <B as Backend>::FloatTensorPrimitive
Backward pass for the conv2d operation, returning the gradient for
weight.Source§fn conv2d_bias_backward(
x: <B as Backend>::FloatTensorPrimitive,
weight: <B as Backend>::FloatTensorPrimitive,
bias: <B as Backend>::FloatTensorPrimitive,
output_grad: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn conv2d_bias_backward( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, bias: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
Backward pass for the conv2d operation, returning the gradient for
bias.Source§fn conv3d_x_backward(
x: <B as Backend>::FloatTensorPrimitive,
weight: <B as Backend>::FloatTensorPrimitive,
output_grad: <B as Backend>::FloatTensorPrimitive,
options: ConvOptions<3>,
) -> <B as Backend>::FloatTensorPrimitive
fn conv3d_x_backward( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvOptions<3>, ) -> <B as Backend>::FloatTensorPrimitive
Backward pass for the conv3d operation, returning the gradient for
x.Source§fn conv3d_weight_backward(
x: <B as Backend>::FloatTensorPrimitive,
weight: <B as Backend>::FloatTensorPrimitive,
output_grad: <B as Backend>::FloatTensorPrimitive,
options: ConvOptions<3>,
) -> <B as Backend>::FloatTensorPrimitive
fn conv3d_weight_backward( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvOptions<3>, ) -> <B as Backend>::FloatTensorPrimitive
Backward pass for the conv3d operation, returning the gradient for
weight.Source§fn conv3d_bias_backward(
x: <B as Backend>::FloatTensorPrimitive,
weight: <B as Backend>::FloatTensorPrimitive,
bias: <B as Backend>::FloatTensorPrimitive,
output_grad: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn conv3d_bias_backward( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, bias: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
Backward pass for the conv3d operation, returning the gradient for
bias.Source§fn conv_transpose1d_x_backward(
weight: <B as Backend>::FloatTensorPrimitive,
output_grad: <B as Backend>::FloatTensorPrimitive,
options: ConvTransposeOptions<1>,
) -> <B as Backend>::FloatTensorPrimitive
fn conv_transpose1d_x_backward( weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvTransposeOptions<1>, ) -> <B as Backend>::FloatTensorPrimitive
Backward pass for the conv transpose 1d operation, returning the gradient for
x.Source§fn conv_transpose1d_weight_backward(
x: <B as Backend>::FloatTensorPrimitive,
weight: <B as Backend>::FloatTensorPrimitive,
output_grad: <B as Backend>::FloatTensorPrimitive,
options: ConvTransposeOptions<1>,
) -> <B as Backend>::FloatTensorPrimitive
fn conv_transpose1d_weight_backward( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvTransposeOptions<1>, ) -> <B as Backend>::FloatTensorPrimitive
Backward pass for the conv transpose 1d operation, returning the gradient for
weight.Source§fn conv_transpose1d_bias_backward(
x: <B as Backend>::FloatTensorPrimitive,
bias: <B as Backend>::FloatTensorPrimitive,
output_grad: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn conv_transpose1d_bias_backward( x: <B as Backend>::FloatTensorPrimitive, bias: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
Backward pass for the conv transpose 1d operation, returning the gradient for
bias.Source§fn conv_transpose2d_x_backward(
weight: <B as Backend>::FloatTensorPrimitive,
output_grad: <B as Backend>::FloatTensorPrimitive,
options: ConvTransposeOptions<2>,
) -> <B as Backend>::FloatTensorPrimitive
fn conv_transpose2d_x_backward( weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvTransposeOptions<2>, ) -> <B as Backend>::FloatTensorPrimitive
Backward pass for the conv transpose 2d operation, returning the gradient for
x.Source§fn conv_transpose2d_weight_backward(
x: <B as Backend>::FloatTensorPrimitive,
weight: <B as Backend>::FloatTensorPrimitive,
output_grad: <B as Backend>::FloatTensorPrimitive,
options: ConvTransposeOptions<2>,
) -> <B as Backend>::FloatTensorPrimitive
fn conv_transpose2d_weight_backward( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvTransposeOptions<2>, ) -> <B as Backend>::FloatTensorPrimitive
Backward pass for the conv transpose 2d operation, returning the gradient for
weight.Source§fn conv_transpose2d_bias_backward(
x: <B as Backend>::FloatTensorPrimitive,
bias: <B as Backend>::FloatTensorPrimitive,
output_grad: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn conv_transpose2d_bias_backward( x: <B as Backend>::FloatTensorPrimitive, bias: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
Backward pass for the conv transpose 2d operation, returning the gradient for
bias.Source§fn conv_transpose3d_x_backward(
weight: <B as Backend>::FloatTensorPrimitive,
output_grad: <B as Backend>::FloatTensorPrimitive,
options: ConvTransposeOptions<3>,
) -> <B as Backend>::FloatTensorPrimitive
fn conv_transpose3d_x_backward( weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvTransposeOptions<3>, ) -> <B as Backend>::FloatTensorPrimitive
Backward pass for the conv transpose 3d operation, returning the gradient for
x.Source§fn conv_transpose3d_weight_backward(
x: <B as Backend>::FloatTensorPrimitive,
weight: <B as Backend>::FloatTensorPrimitive,
output_grad: <B as Backend>::FloatTensorPrimitive,
options: ConvTransposeOptions<3>,
) -> <B as Backend>::FloatTensorPrimitive
fn conv_transpose3d_weight_backward( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvTransposeOptions<3>, ) -> <B as Backend>::FloatTensorPrimitive
Backward pass for the conv transpose 3d operation, returning the gradient for
weight.Source§fn conv_transpose3d_bias_backward(
x: <B as Backend>::FloatTensorPrimitive,
bias: <B as Backend>::FloatTensorPrimitive,
output_grad: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn conv_transpose3d_bias_backward( x: <B as Backend>::FloatTensorPrimitive, bias: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
Backward pass for the conv transpose 3d operation, returning the gradient for
bias.Source§fn unfold4d(
x: <B as Backend>::FloatTensorPrimitive,
kernel_size: [usize; 2],
options: UnfoldOptions,
) -> <B as Backend>::FloatTensorPrimitive
fn unfold4d( x: <B as Backend>::FloatTensorPrimitive, kernel_size: [usize; 2], options: UnfoldOptions, ) -> <B as Backend>::FloatTensorPrimitive
Four-dimensional unfolding. Read more
Source§fn avg_pool1d_backward(
x: <B as Backend>::FloatTensorPrimitive,
grad: <B as Backend>::FloatTensorPrimitive,
kernel_size: usize,
stride: usize,
padding: usize,
count_include_pad: bool,
) -> <B as Backend>::FloatTensorPrimitive
fn avg_pool1d_backward( x: <B as Backend>::FloatTensorPrimitive, grad: <B as Backend>::FloatTensorPrimitive, kernel_size: usize, stride: usize, padding: usize, count_include_pad: bool, ) -> <B as Backend>::FloatTensorPrimitive
Backward pass for the avg pooling 1d operation.
Source§fn adaptive_avg_pool1d_backward(
x: <B as Backend>::FloatTensorPrimitive,
grad: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn adaptive_avg_pool1d_backward( x: <B as Backend>::FloatTensorPrimitive, grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
Backward pass for the adaptive avg pooling 1d operation.
Source§fn max_pool1d_with_indices_backward(
x: <B as Backend>::FloatTensorPrimitive,
kernel_size: usize,
stride: usize,
padding: usize,
dilation: usize,
output_grad: <B as Backend>::FloatTensorPrimitive,
indices: <B as Backend>::IntTensorPrimitive,
) -> MaxPool1dBackward<B>
fn max_pool1d_with_indices_backward( x: <B as Backend>::FloatTensorPrimitive, kernel_size: usize, stride: usize, padding: usize, dilation: usize, output_grad: <B as Backend>::FloatTensorPrimitive, indices: <B as Backend>::IntTensorPrimitive, ) -> MaxPool1dBackward<B>
Backward pass for the max pooling 1d operation.
Source§impl<E: TchElement> QTensorOps<LibTorch<E>> for LibTorch<E>
impl<E: TchElement> QTensorOps<LibTorch<E>> for LibTorch<E>
Source§fn q_from_data(
_data: TensorData,
_device: &LibTorchDevice,
) -> QuantizedTensor<Self>
fn q_from_data( _data: TensorData, _device: &LibTorchDevice, ) -> QuantizedTensor<Self>
Creates a new tensor from the data structure. Read more
Source§fn quantize(
_tensor: FloatTensor<Self>,
_scheme: &QuantScheme,
_qparams: QuantizationParametersPrimitive<Self>,
) -> QuantizedTensor<Self>
fn quantize( _tensor: FloatTensor<Self>, _scheme: &QuantScheme, _qparams: QuantizationParametersPrimitive<Self>, ) -> QuantizedTensor<Self>
Convert the tensor to a lower precision data type based on the quantization scheme and parameters.
Source§fn quantize_dynamic(
_tensor: FloatTensor<Self>,
_scheme: &QuantScheme,
) -> QuantizedTensor<Self>
fn quantize_dynamic( _tensor: FloatTensor<Self>, _scheme: &QuantScheme, ) -> QuantizedTensor<Self>
Dynamically convert the tensor to a lower precision data type based on the quantization scheme.
Source§fn dequantize(_tensor: QuantizedTensor<Self>) -> FloatTensor<Self>
fn dequantize(_tensor: QuantizedTensor<Self>) -> FloatTensor<Self>
Convert the tensor back to a higher precision data type.
Source§fn q_device(_tensor: &QuantizedTensor<Self>) -> LibTorchDevice
fn q_device(_tensor: &QuantizedTensor<Self>) -> LibTorchDevice
Gets the device of the tensor. Read more
Source§fn q_to_device(
_tensor: QuantizedTensor<Self>,
_device: &Device<Self>,
) -> QuantizedTensor<Self>
fn q_to_device( _tensor: QuantizedTensor<Self>, _device: &Device<Self>, ) -> QuantizedTensor<Self>
Moves the tensor to the given device. Read more
Source§fn q_reshape(
_tensor: QuantizedTensor<Self>,
_shape: Shape,
) -> QuantizedTensor<Self>
fn q_reshape( _tensor: QuantizedTensor<Self>, _shape: Shape, ) -> QuantizedTensor<Self>
Reshapes a tensor. Read more
Source§async fn q_into_data(_tensor: QuantizedTensor<Self>) -> TensorData
async fn q_into_data(_tensor: QuantizedTensor<Self>) -> TensorData
Converts the tensor to a data structure. Read more
Source§fn q_swap_dims(
_tensor: QuantizedTensor<Self>,
_dim1: usize,
_dim2: usize,
) -> QuantizedTensor<Self>
fn q_swap_dims( _tensor: QuantizedTensor<Self>, _dim1: usize, _dim2: usize, ) -> QuantizedTensor<Self>
Swaps two dimensions of a tensor. Read more
Source§fn q_permute(
_tensor: QuantizedTensor<Self>,
_axes: &[usize],
) -> QuantizedTensor<Self>
fn q_permute( _tensor: QuantizedTensor<Self>, _axes: &[usize], ) -> QuantizedTensor<Self>
Permutes the dimensions of a tensor. Read more
Source§fn q_flip(
_tensor: QuantizedTensor<Self>,
_axes: &[usize],
) -> QuantizedTensor<Self>
fn q_flip( _tensor: QuantizedTensor<Self>, _axes: &[usize], ) -> QuantizedTensor<Self>
Reverse the order of elements in a tensor along the given axes. Read more
Source§fn q_select(
_tensor: QuantizedTensor<Self>,
_dim: usize,
_indices: IntTensor<Self>,
) -> QuantizedTensor<Self>
fn q_select( _tensor: QuantizedTensor<Self>, _dim: usize, _indices: IntTensor<Self>, ) -> QuantizedTensor<Self>
Select tensor elements along the given dimension corresponding for the given indices. Read more
Source§fn q_slice(
_tensor: QuantizedTensor<Self>,
_slices: &[Slice],
) -> QuantizedTensor<Self>
fn q_slice( _tensor: QuantizedTensor<Self>, _slices: &[Slice], ) -> QuantizedTensor<Self>
Select tensor elements corresponding to the given slices. Read more
Source§fn q_argmax(_tensor: QuantizedTensor<Self>, _dim: usize) -> IntTensor<Self>
fn q_argmax(_tensor: QuantizedTensor<Self>, _dim: usize) -> IntTensor<Self>
Gets the indices of the maximum elements of a tensor along an axis. Read more
Source§fn q_argmin(_tensor: QuantizedTensor<Self>, _dim: usize) -> IntTensor<Self>
fn q_argmin(_tensor: QuantizedTensor<Self>, _dim: usize) -> IntTensor<Self>
Gets the indices of the minimum elements of a tensor along an axis. Read more
Source§fn q_max_dim_with_indices(
_tensor: QuantizedTensor<Self>,
_dim: usize,
) -> (QuantizedTensor<Self>, IntTensor<Self>)
fn q_max_dim_with_indices( _tensor: QuantizedTensor<Self>, _dim: usize, ) -> (QuantizedTensor<Self>, IntTensor<Self>)
Gets the maximum elements of a tensor along an axis and their indices. Read more
Source§fn q_max_dim(
_tensor: QuantizedTensor<Self>,
_dim: usize,
) -> QuantizedTensor<Self>
fn q_max_dim( _tensor: QuantizedTensor<Self>, _dim: usize, ) -> QuantizedTensor<Self>
Gets the maximum elements of a tensor along an axis. Read more
Source§fn q_min_dim(
_tensor: QuantizedTensor<Self>,
_dim: usize,
) -> QuantizedTensor<Self>
fn q_min_dim( _tensor: QuantizedTensor<Self>, _dim: usize, ) -> QuantizedTensor<Self>
Gets the minimum elements of a tensor along an axis. Read more
Source§fn q_min_dim_with_indices(
_tensor: QuantizedTensor<Self>,
_dim: usize,
) -> (QuantizedTensor<Self>, IntTensor<Self>)
fn q_min_dim_with_indices( _tensor: QuantizedTensor<Self>, _dim: usize, ) -> (QuantizedTensor<Self>, IntTensor<Self>)
Gets the minimum elements of a tensor along an axis and their indices. Read more
Source§fn q_expand(
_tensor: QuantizedTensor<Self>,
_shape: Shape,
) -> QuantizedTensor<Self>
fn q_expand( _tensor: QuantizedTensor<Self>, _shape: Shape, ) -> QuantizedTensor<Self>
Broadcasts the
tensor to the given shape.Source§fn q_sort(
_tensor: QuantizedTensor<Self>,
_dim: usize,
_descending: bool,
) -> QuantizedTensor<Self>
fn q_sort( _tensor: QuantizedTensor<Self>, _dim: usize, _descending: bool, ) -> QuantizedTensor<Self>
Sort the elements of the input
tensor by value in along a given dimension. Read moreSource§fn q_sort_with_indices(
_tensor: QuantizedTensor<Self>,
_dim: usize,
_descending: bool,
) -> (QuantizedTensor<Self>, IntTensor<Self>)
fn q_sort_with_indices( _tensor: QuantizedTensor<Self>, _dim: usize, _descending: bool, ) -> (QuantizedTensor<Self>, IntTensor<Self>)
Sort the elements of the input
tensor by value in along a given dimension. Read moreSource§fn q_argsort(
_tensor: QuantizedTensor<Self>,
_dim: usize,
_descending: bool,
) -> IntTensor<Self>
fn q_argsort( _tensor: QuantizedTensor<Self>, _dim: usize, _descending: bool, ) -> IntTensor<Self>
Returns the indices that sort the elements of the input
tensor by value along a given dimension. Read moreSource§fn q_detach(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_detach( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Detaches a tensor from the computation graph.
Source§fn q_set_require_grad(
tensor: <B as Backend>::QuantizedTensorPrimitive,
_require_grad: bool,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_set_require_grad( tensor: <B as Backend>::QuantizedTensorPrimitive, _require_grad: bool, ) -> <B as Backend>::QuantizedTensorPrimitive
Sets the
require_grad flag of a tensor.Source§fn q_is_require_grad(_tensor: &<B as Backend>::QuantizedTensorPrimitive) -> bool
fn q_is_require_grad(_tensor: &<B as Backend>::QuantizedTensorPrimitive) -> bool
Returns the
require_grad flag of a tensor.Source§fn q_transpose(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_transpose( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Transposes a tensor. Read more
Source§fn q_gather(
dim: usize,
tensor: <B as Backend>::QuantizedTensorPrimitive,
indices: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_gather( dim: usize, tensor: <B as Backend>::QuantizedTensorPrimitive, indices: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Gather elements from a tensor. Read more
Source§fn q_repeat_dim(
tensor: <B as Backend>::QuantizedTensorPrimitive,
dim: usize,
times: usize,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_repeat_dim( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, times: usize, ) -> <B as Backend>::QuantizedTensorPrimitive
Repeat the tensor along the given dimension. Read more
Source§fn q_add(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::QuantizedTensorPrimitive,
) -> TensorPrimitive<B>
fn q_add( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::QuantizedTensorPrimitive, ) -> TensorPrimitive<B>
Adds two tensors together. Read more
Source§fn q_add_scalar(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::FloatElem,
) -> TensorPrimitive<B>
fn q_add_scalar( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> TensorPrimitive<B>
Adds a scalar to a tensor. Read more
Source§fn q_clamp_min(
tensor: <B as Backend>::QuantizedTensorPrimitive,
min: <B as Backend>::FloatElem,
) -> TensorPrimitive<B>
fn q_clamp_min( tensor: <B as Backend>::QuantizedTensorPrimitive, min: <B as Backend>::FloatElem, ) -> TensorPrimitive<B>
Clamps a tensor under a minimum value. Read more
Source§fn q_clamp_max(
tensor: <B as Backend>::QuantizedTensorPrimitive,
max: <B as Backend>::FloatElem,
) -> TensorPrimitive<B>
fn q_clamp_max( tensor: <B as Backend>::QuantizedTensorPrimitive, max: <B as Backend>::FloatElem, ) -> TensorPrimitive<B>
Clamps a tensor over a maximum value. Read more
Source§fn q_clamp(
tensor: <B as Backend>::QuantizedTensorPrimitive,
min: <B as Backend>::FloatElem,
max: <B as Backend>::FloatElem,
) -> TensorPrimitive<B>
fn q_clamp( tensor: <B as Backend>::QuantizedTensorPrimitive, min: <B as Backend>::FloatElem, max: <B as Backend>::FloatElem, ) -> TensorPrimitive<B>
Clamps a tensor between a minimum and maximum value. Read more
Source§fn q_sub(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::QuantizedTensorPrimitive,
) -> TensorPrimitive<B>
fn q_sub( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::QuantizedTensorPrimitive, ) -> TensorPrimitive<B>
Subtracts two tensors. Read more
Source§fn q_sub_scalar(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::FloatElem,
) -> TensorPrimitive<B>
fn q_sub_scalar( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> TensorPrimitive<B>
Subtracts a scalar from a tensor. Read more
Source§fn q_mul(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::QuantizedTensorPrimitive,
) -> TensorPrimitive<B>
fn q_mul( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::QuantizedTensorPrimitive, ) -> TensorPrimitive<B>
Multiplies two tensors together element-wise.
Source§fn q_mul_scalar(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::FloatElem,
) -> TensorPrimitive<B>
fn q_mul_scalar( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> TensorPrimitive<B>
Multiplies a tensor by a scalar. Read more
Source§fn q_div(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::QuantizedTensorPrimitive,
) -> TensorPrimitive<B>
fn q_div( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::QuantizedTensorPrimitive, ) -> TensorPrimitive<B>
Divides two tensors element-wise. Read more
Source§fn q_div_scalar(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::FloatElem,
) -> TensorPrimitive<B>
fn q_div_scalar( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> TensorPrimitive<B>
Divides a tensor by a scalar. Read more
Source§fn q_matmul(
lhs: TensorPrimitive<B>,
rhs: TensorPrimitive<B>,
) -> TensorPrimitive<B>
fn q_matmul( lhs: TensorPrimitive<B>, rhs: TensorPrimitive<B>, ) -> TensorPrimitive<B>
Multiplies two tensors together using matrix multiplication. Read more
Source§fn q_neg(tensor: <B as Backend>::QuantizedTensorPrimitive) -> TensorPrimitive<B>
fn q_neg(tensor: <B as Backend>::QuantizedTensorPrimitive) -> TensorPrimitive<B>
Negates a tensor element-wise.
Source§fn q_recip(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> TensorPrimitive<B>
fn q_recip( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> TensorPrimitive<B>
Calculates the reciprocals element-wise
Source§fn q_sum(tensor: <B as Backend>::QuantizedTensorPrimitive) -> TensorPrimitive<B>
fn q_sum(tensor: <B as Backend>::QuantizedTensorPrimitive) -> TensorPrimitive<B>
Sum of all elements in a tensor. Read more
Source§fn q_sum_dim(
tensor: <B as Backend>::QuantizedTensorPrimitive,
dim: usize,
) -> TensorPrimitive<B>
fn q_sum_dim( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> TensorPrimitive<B>
Sum of all elements in a tensor along a dimension. Read more
Source§fn q_prod(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> TensorPrimitive<B>
fn q_prod( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> TensorPrimitive<B>
Product of all elements in a tensor. Read more
Source§fn q_prod_dim(
tensor: <B as Backend>::QuantizedTensorPrimitive,
dim: usize,
) -> TensorPrimitive<B>
fn q_prod_dim( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> TensorPrimitive<B>
Product of all elements in a tensor along a dimension. Read more
Source§fn q_mean(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> TensorPrimitive<B>
fn q_mean( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> TensorPrimitive<B>
Mean of all elements in a tensor. Read more
Source§fn q_mean_dim(
tensor: <B as Backend>::QuantizedTensorPrimitive,
dim: usize,
) -> TensorPrimitive<B>
fn q_mean_dim( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> TensorPrimitive<B>
Mean of all elements in a tensor along a dimension. Read more
Source§fn q_cumsum(
tensor: <B as Backend>::QuantizedTensorPrimitive,
dim: usize,
) -> TensorPrimitive<B>
fn q_cumsum( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> TensorPrimitive<B>
Computes the cumulative sum of elements along a dimension. Read more
Source§fn q_cumprod(
tensor: <B as Backend>::QuantizedTensorPrimitive,
dim: usize,
) -> TensorPrimitive<B>
fn q_cumprod( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> TensorPrimitive<B>
Computes the cumulative product of elements along a dimension. Read more
Source§fn q_cummin(
tensor: <B as Backend>::QuantizedTensorPrimitive,
dim: usize,
) -> TensorPrimitive<B>
fn q_cummin( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> TensorPrimitive<B>
Computes the cumulative minimum of elements along a dimension. Read more
Source§fn q_cummax(
tensor: <B as Backend>::QuantizedTensorPrimitive,
dim: usize,
) -> TensorPrimitive<B>
fn q_cummax( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> TensorPrimitive<B>
Computes the cumulative maximum of elements along a dimension. Read more
Source§fn q_exp(tensor: <B as Backend>::QuantizedTensorPrimitive) -> TensorPrimitive<B>
fn q_exp(tensor: <B as Backend>::QuantizedTensorPrimitive) -> TensorPrimitive<B>
Returns a new tensor with exponential values. Read more
Source§fn q_log(tensor: <B as Backend>::QuantizedTensorPrimitive) -> TensorPrimitive<B>
fn q_log(tensor: <B as Backend>::QuantizedTensorPrimitive) -> TensorPrimitive<B>
Returns a new tensor with natural logarithm values. Read more
Source§fn q_log1p(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> TensorPrimitive<B>
fn q_log1p( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> TensorPrimitive<B>
Returns a new tensor with logarithm values of (1 + Xi). Read more
Source§fn q_powf(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::QuantizedTensorPrimitive,
) -> TensorPrimitive<B>
fn q_powf( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::QuantizedTensorPrimitive, ) -> TensorPrimitive<B>
Element-wise power with another tensor. Read more
Source§fn q_powi(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> TensorPrimitive<B>
fn q_powi( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> TensorPrimitive<B>
Element-wise power with an IntTensor. Read more
Source§fn q_powi_scalar(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> TensorPrimitive<B>
fn q_powi_scalar( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> TensorPrimitive<B>
Element-wise power with an int scalar. Read more
Source§fn q_powf_scalar(
tensor: <B as Backend>::QuantizedTensorPrimitive,
value: f32,
) -> TensorPrimitive<B>
fn q_powf_scalar( tensor: <B as Backend>::QuantizedTensorPrimitive, value: f32, ) -> TensorPrimitive<B>
Element-wise power with a float scalar. Read more
Source§fn q_sqrt(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> TensorPrimitive<B>
fn q_sqrt( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> TensorPrimitive<B>
Returns a new tensor with square root values. Read more
Source§fn q_abs(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_abs( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Returns a new tensor with absolute values. Read more
Source§fn q_cos(tensor: <B as Backend>::QuantizedTensorPrimitive) -> TensorPrimitive<B>
fn q_cos(tensor: <B as Backend>::QuantizedTensorPrimitive) -> TensorPrimitive<B>
Returns a new tensor with cosine values. Read more
Source§fn q_sin(tensor: <B as Backend>::QuantizedTensorPrimitive) -> TensorPrimitive<B>
fn q_sin(tensor: <B as Backend>::QuantizedTensorPrimitive) -> TensorPrimitive<B>
Returns a new tensor with sine values. Read more
Source§fn q_tan(tensor: <B as Backend>::QuantizedTensorPrimitive) -> TensorPrimitive<B>
fn q_tan(tensor: <B as Backend>::QuantizedTensorPrimitive) -> TensorPrimitive<B>
Returns a new tensor with tangent values. Read more
Source§fn q_cosh(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> TensorPrimitive<B>
fn q_cosh( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> TensorPrimitive<B>
Returns a new tensor with hyperbolic cosine values. Read more
Source§fn q_sinh(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> TensorPrimitive<B>
fn q_sinh( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> TensorPrimitive<B>
Returns a new tensor with hyperbolic sine values. Read more
Source§fn q_tanh(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> TensorPrimitive<B>
fn q_tanh( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> TensorPrimitive<B>
Returns a new tensor with hyperbolic tangent values. Read more
Source§fn q_erf(tensor: <B as Backend>::QuantizedTensorPrimitive) -> TensorPrimitive<B>
fn q_erf(tensor: <B as Backend>::QuantizedTensorPrimitive) -> TensorPrimitive<B>
Returns a new tensor with the error function values. Read more
Source§fn q_cat(
tensors: Vec<<B as Backend>::QuantizedTensorPrimitive>,
dim: usize,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_cat( tensors: Vec<<B as Backend>::QuantizedTensorPrimitive>, dim: usize, ) -> <B as Backend>::QuantizedTensorPrimitive
Concatenates tensors along a dimension. Read more
Source§fn q_max(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_max( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Gets the maximum element of a tensor. Read more
Source§fn q_min(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_min( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Gets the minimum element of a tensor. Read more
Source§fn q_max_abs(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_max_abs( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Gets the maximum element of a tensor. Read more
Source§fn q_max_abs_dim(
tensor: <B as Backend>::QuantizedTensorPrimitive,
dim: usize,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_max_abs_dim( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <B as Backend>::QuantizedTensorPrimitive
Gets the maximum elements of a tensor along an axis. Read more
Source§fn q_any(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn q_any( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
Tests if any element in the
tensor evaluates to True. Read moreSource§fn q_any_dim(
tensor: <B as Backend>::QuantizedTensorPrimitive,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive
fn q_any_dim( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive
Source§fn q_all(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn q_all( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
Tests if all elements in the
tensor evaluate to True. Read moreSource§fn q_all_dim(
tensor: <B as Backend>::QuantizedTensorPrimitive,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive
fn q_all_dim( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive
Source§impl<E: TchElement> TransactionOps<LibTorch<E>> for LibTorch<E>
impl<E: TchElement> TransactionOps<LibTorch<E>> for LibTorch<E>
Source§fn tr_execute(
transaction: TransactionPrimitive<B>,
) -> impl Future<Output = TransactionPrimitiveResult> + Send
fn tr_execute( transaction: TransactionPrimitive<B>, ) -> impl Future<Output = TransactionPrimitiveResult> + Send
Executes a transaction and return its
result.
impl<E: Copy> Copy for LibTorch<E>
Auto Trait Implementations§
impl<E> Freeze for LibTorch<E>where
E: Freeze,
impl<E> RefUnwindSafe for LibTorch<E>where
E: RefUnwindSafe,
impl<E> Send for LibTorch<E>where
E: Send,
impl<E> Sync for LibTorch<E>where
E: Sync,
impl<E> Unpin for LibTorch<E>where
E: Unpin,
impl<E> UnwindSafe for LibTorch<E>where
E: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more