pub struct LibTorch<E = f32, Q = i8> { /* 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§
§impl<E, Q> ActivationOps<LibTorch<E, Q>> for LibTorch<E, Q>where
E: TchElement,
Q: QuantElement,
impl<E, Q> ActivationOps<LibTorch<E, Q>> for LibTorch<E, Q>where
E: TchElement,
Q: QuantElement,
§fn gelu_backward(tensor: TchTensor<E>, grad: TchTensor<E>) -> TchTensor<E>
fn gelu_backward(tensor: TchTensor<E>, grad: TchTensor<E>) -> TchTensor<E>
Applies the Gelu activation function backward. Read more
§fn log_sigmoid(tensor: TchTensor<E>) -> TchTensor<E>
fn log_sigmoid(tensor: TchTensor<E>) -> TchTensor<E>
Applies the LogSigmoid activation function. Read more
§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
§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
§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
§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
§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
§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
§impl<E, Q> Backend for LibTorch<E, Q>where
E: TchElement,
Q: QuantElement,
impl<E, Q> Backend for LibTorch<E, Q>where
E: TchElement,
Q: QuantElement,
§type Device = LibTorchDevice
type Device = LibTorchDevice
Device type.
§type FullPrecisionBridge = PrecisionBridge<f32>
type FullPrecisionBridge = PrecisionBridge<f32>
A bridge that can cast tensors to full precision.
§type FloatTensorPrimitive = TchTensor<E>
type FloatTensorPrimitive = TchTensor<E>
Tensor primitive to be used for all float operations.
§type IntTensorPrimitive = TchTensor<i64>
type IntTensorPrimitive = TchTensor<i64>
Tensor primitive to be used for all int operations.
§type BoolTensorPrimitive = TchTensor<bool>
type BoolTensorPrimitive = TchTensor<bool>
Tensor primitive to be used for all bool operations.
§type QuantizedTensorPrimitive = TchQTensor<Q>
type QuantizedTensorPrimitive = TchQTensor<Q>
Tensor primitive to be used for all quantized operations.
§type QuantizedEncoding = Q
type QuantizedEncoding = Q
Quantized tensor encoding type.
§fn ad_enabled() -> bool
fn ad_enabled() -> bool
If autodiff is enabled.
§impl<TElem, OElem, QElem> BackendBridge<LibTorch<OElem, QElem>> for PrecisionBridge<TElem>
impl<TElem, OElem, QElem> BackendBridge<LibTorch<OElem, QElem>> for PrecisionBridge<TElem>
§fn into_target(
tensor: <LibTorch<OElem> as Backend>::FloatTensorPrimitive,
device: Option<<<PrecisionBridge<TElem> as BackendBridge<LibTorch<OElem, QElem>>>::Target as Backend>::Device>,
) -> <<PrecisionBridge<TElem> as BackendBridge<LibTorch<OElem, QElem>>>::Target as Backend>::FloatTensorPrimitive
fn into_target( tensor: <LibTorch<OElem> as Backend>::FloatTensorPrimitive, device: Option<<<PrecisionBridge<TElem> as BackendBridge<LibTorch<OElem, QElem>>>::Target as Backend>::Device>, ) -> <<PrecisionBridge<TElem> as BackendBridge<LibTorch<OElem, QElem>>>::Target as Backend>::FloatTensorPrimitive
Transfer the tensor to the target backend.
§fn from_target(
tensor: <<PrecisionBridge<TElem> as BackendBridge<LibTorch<OElem, QElem>>>::Target as Backend>::FloatTensorPrimitive,
device: Option<<LibTorch<OElem> as Backend>::Device>,
) -> <LibTorch<OElem> as Backend>::FloatTensorPrimitive
fn from_target( tensor: <<PrecisionBridge<TElem> as BackendBridge<LibTorch<OElem, QElem>>>::Target as Backend>::FloatTensorPrimitive, device: Option<<LibTorch<OElem> as Backend>::Device>, ) -> <LibTorch<OElem> as Backend>::FloatTensorPrimitive
Transfer the tensor from the target backend.
§impl<E, Q> BoolTensorOps<LibTorch<E, Q>> for LibTorch<E, Q>where
E: TchElement,
Q: QuantElement,
impl<E, Q> BoolTensorOps<LibTorch<E, Q>> for LibTorch<E, Q>where
E: TchElement,
Q: QuantElement,
§fn bool_from_data(data: TensorData, device: &LibTorchDevice) -> TchTensor<bool>
fn bool_from_data(data: TensorData, device: &LibTorchDevice) -> TchTensor<bool>
Creates a tensor from the data structure. Read more
§fn bool_repeat_dim(
tensor: TchTensor<bool>,
dim: usize,
times: usize,
) -> TchTensor<bool>
fn bool_repeat_dim( tensor: TchTensor<bool>, dim: usize, times: usize, ) -> TchTensor<bool>
Repeats one dimension of the tensor a given number of times along that dimension. Read more
§async fn bool_into_data(tensor: TchTensor<bool>) -> TensorData
async fn bool_into_data(tensor: TchTensor<bool>) -> TensorData
Converts the tensor to a data structure. Read more
§fn bool_to_device(
tensor: TchTensor<bool>,
device: &LibTorchDevice,
) -> TchTensor<bool>
fn bool_to_device( tensor: TchTensor<bool>, device: &LibTorchDevice, ) -> TchTensor<bool>
Moves the tensor to the device.
§fn bool_reshape(tensor: TchTensor<bool>, shape: Shape) -> TchTensor<bool>
fn bool_reshape(tensor: TchTensor<bool>, shape: Shape) -> TchTensor<bool>
Reshapes the tensor. Read more
§fn bool_device(tensor: &TchTensor<bool>) -> LibTorchDevice
fn bool_device(tensor: &TchTensor<bool>) -> LibTorchDevice
Gets the device of the tensor. Read more
§fn bool_empty(
shape: Shape,
device: &<LibTorch<E> as Backend>::Device,
) -> TchTensor<bool>
fn bool_empty( shape: Shape, device: &<LibTorch<E> as Backend>::Device, ) -> TchTensor<bool>
Creates a new bool tensor. Read more
§fn bool_slice(
tensor: TchTensor<bool>,
ranges: &[Range<usize>],
) -> TchTensor<bool>
fn bool_slice( tensor: TchTensor<bool>, ranges: &[Range<usize>], ) -> TchTensor<bool>
Gets the values from the tensor for the given ranges. Read more
§fn bool_slice_assign(
tensor: TchTensor<bool>,
ranges: &[Range<usize>],
value: TchTensor<bool>,
) -> TchTensor<bool>
fn bool_slice_assign( tensor: TchTensor<bool>, ranges: &[Range<usize>], value: TchTensor<bool>, ) -> TchTensor<bool>
Sets the values in the tensor for the given ranges. Read more
§fn bool_cat(tensors: Vec<TchTensor<bool>>, dim: usize) -> TchTensor<bool>
fn bool_cat(tensors: Vec<TchTensor<bool>>, dim: usize) -> TchTensor<bool>
Concatenates the tensors along the given dimension. Read more
§fn bool_equal(lhs: TchTensor<bool>, rhs: TchTensor<bool>) -> TchTensor<bool>
fn bool_equal(lhs: TchTensor<bool>, rhs: TchTensor<bool>) -> TchTensor<bool>
Equates the two tensors. Read more
§fn bool_into_int(tensor: TchTensor<bool>) -> TchTensor<i64>
fn bool_into_int(tensor: TchTensor<bool>) -> TchTensor<i64>
Converts bool tensor to int tensor. Read more
§fn bool_into_float(tensor: TchTensor<bool>) -> TchTensor<E>
fn bool_into_float(tensor: TchTensor<bool>) -> TchTensor<E>
Converts bool tensor to float tensor. Read more
§fn bool_swap_dims(
tensor: TchTensor<bool>,
dim1: usize,
dim2: usize,
) -> TchTensor<bool>
fn bool_swap_dims( tensor: TchTensor<bool>, dim1: usize, dim2: usize, ) -> TchTensor<bool>
Swaps two dimensions of a bool tensor. Read more
§fn bool_narrow(
tensor: TchTensor<bool>,
dim: usize,
start: usize,
length: usize,
) -> TchTensor<bool>
fn bool_narrow( tensor: TchTensor<bool>, dim: usize, start: usize, length: usize, ) -> TchTensor<bool>
Returns a new tensor with the given dimension narrowed to the given range. Read more
§fn bool_chunk(
tensor: TchTensor<bool>,
chunks: usize,
dim: usize,
) -> Vec<TchTensor<bool>>
fn bool_chunk( tensor: TchTensor<bool>, chunks: usize, dim: usize, ) -> Vec<TchTensor<bool>>
Split the tensor along the given dimension into chunks. Read more
§fn bool_permute(tensor: TchTensor<bool>, axes: &[usize]) -> TchTensor<bool>
fn bool_permute(tensor: TchTensor<bool>, axes: &[usize]) -> TchTensor<bool>
Permutes the dimensions of a tensor. Read more
§fn bool_flip(tensor: TchTensor<bool>, axes: &[usize]) -> TchTensor<bool>
fn bool_flip(tensor: TchTensor<bool>, axes: &[usize]) -> TchTensor<bool>
Reverse the order of elements in a tensor along the given axes. Read more
§async fn bool_argwhere(tensor: TchTensor<bool>) -> TchTensor<i64>
async fn bool_argwhere(tensor: TchTensor<bool>) -> TchTensor<i64>
Compute the indices of the elements that are non-zero, grouped by element. Read more
§async fn bool_nonzero(tensor: TchTensor<bool>) -> Vec<TchTensor<i64>>
async fn bool_nonzero(tensor: TchTensor<bool>) -> Vec<TchTensor<i64>>
Compute the indices of the elements that are non-zero. Read more
§fn bool_expand(tensor: TchTensor<bool>, shape: Shape) -> TchTensor<bool>
fn bool_expand(tensor: TchTensor<bool>, shape: Shape) -> TchTensor<bool>
Broadcasts the bool
tensor
to the given shape
.§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
§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
§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 more§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
§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 more§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
§impl<E, Q> FloatTensorOps<LibTorch<E, Q>> for LibTorch<E, Q>where
E: TchElement,
Q: QuantElement,
impl<E, Q> FloatTensorOps<LibTorch<E, Q>> for LibTorch<E, Q>where
E: TchElement,
Q: QuantElement,
§fn float_from_data(data: TensorData, device: &LibTorchDevice) -> TchTensor<E>
fn float_from_data(data: TensorData, device: &LibTorchDevice) -> TchTensor<E>
Creates a new tensor from the data structure. Read more
§fn float_random(
shape: Shape,
distribution: Distribution,
device: &LibTorchDevice,
) -> TchTensor<E>
fn float_random( shape: Shape, distribution: Distribution, device: &LibTorchDevice, ) -> TchTensor<E>
Creates a new tensor with random values. Read more
§fn float_repeat_dim(
tensor: TchTensor<E>,
dim: usize,
times: usize,
) -> TchTensor<E>
fn float_repeat_dim( tensor: TchTensor<E>, dim: usize, times: usize, ) -> TchTensor<E>
Repeat the tensor along the given dimension. Read more
§fn float_zeros(shape: Shape, device: &LibTorchDevice) -> TchTensor<E>
fn float_zeros(shape: Shape, device: &LibTorchDevice) -> TchTensor<E>
Creates a new tensor with zeros. Read more
§fn float_ones(shape: Shape, device: &LibTorchDevice) -> TchTensor<E>
fn float_ones(shape: Shape, device: &LibTorchDevice) -> TchTensor<E>
Creates a new tensor with ones. Read more
§fn float_shape(tensor: &TchTensor<E>) -> Shape
fn float_shape(tensor: &TchTensor<E>) -> Shape
Gets the shape of the tensor. Read more
§async fn float_into_data(tensor: TchTensor<E>) -> TensorData
async fn float_into_data(tensor: TchTensor<E>) -> TensorData
Converts the tensor to a data structure. Read more
§fn float_device(tensor: &TchTensor<E>) -> LibTorchDevice
fn float_device(tensor: &TchTensor<E>) -> LibTorchDevice
Gets the device of the tensor. Read more
§fn float_to_device(
tensor: TchTensor<E>,
device: &LibTorchDevice,
) -> TchTensor<E>
fn float_to_device( tensor: TchTensor<E>, device: &LibTorchDevice, ) -> TchTensor<E>
Moves the tensor to the given device. Read more
§fn float_empty(
shape: Shape,
device: &<LibTorch<E> as Backend>::Device,
) -> TchTensor<E>
fn float_empty( shape: Shape, device: &<LibTorch<E> as Backend>::Device, ) -> TchTensor<E>
Creates an empty tensor with the given shape. Read more
§fn float_add(lhs: TchTensor<E>, rhs: TchTensor<E>) -> TchTensor<E>
fn float_add(lhs: TchTensor<E>, rhs: TchTensor<E>) -> TchTensor<E>
Adds two tensors together. Read more
§fn float_add_scalar(lhs: TchTensor<E>, rhs: E) -> TchTensor<E>
fn float_add_scalar(lhs: TchTensor<E>, rhs: E) -> TchTensor<E>
Adds a scalar to a tensor. Read more
§fn float_sub_scalar(lhs: TchTensor<E>, rhs: E) -> TchTensor<E>
fn float_sub_scalar(lhs: TchTensor<E>, rhs: E) -> TchTensor<E>
Subtracts a scalar from a tensor. Read more
§fn float_mul(lhs: TchTensor<E>, rhs: TchTensor<E>) -> TchTensor<E>
fn float_mul(lhs: TchTensor<E>, rhs: TchTensor<E>) -> TchTensor<E>
Multiplies two tensors together element-wise.
§fn float_mul_scalar(lhs: TchTensor<E>, rhs: E) -> TchTensor<E>
fn float_mul_scalar(lhs: TchTensor<E>, rhs: E) -> TchTensor<E>
Multiplies a tensor by a scalar. Read more
§fn float_div(lhs: TchTensor<E>, rhs: TchTensor<E>) -> TchTensor<E>
fn float_div(lhs: TchTensor<E>, rhs: TchTensor<E>) -> TchTensor<E>
Divides two tensors element-wise. Read more
§fn float_div_scalar(lhs: TchTensor<E>, rhs: E) -> TchTensor<E>
fn float_div_scalar(lhs: TchTensor<E>, rhs: E) -> TchTensor<E>
Divides a tensor by a scalar. Read more
§fn float_remainder_scalar(lhs: TchTensor<E>, rhs: E) -> TchTensor<E>
fn float_remainder_scalar(lhs: TchTensor<E>, rhs: E) -> TchTensor<E>
Computes the modulus of a tensor given a scalar. Read more
§fn float_matmul(lhs: TchTensor<E>, rhs: TchTensor<E>) -> TchTensor<E>
fn float_matmul(lhs: TchTensor<E>, rhs: TchTensor<E>) -> TchTensor<E>
Multiplies two tensors together using matrix multiplication. Read more
§fn float_recip(tensor: TchTensor<E>) -> TchTensor<E>
fn float_recip(tensor: TchTensor<E>) -> TchTensor<E>
Calculates the reciprocals element-wise
§fn float_swap_dims(
tensor: TchTensor<E>,
dim1: usize,
dim2: usize,
) -> TchTensor<E>
fn float_swap_dims( tensor: TchTensor<E>, dim1: usize, dim2: usize, ) -> TchTensor<E>
Swaps two dimensions of a tensor. Read more
§fn float_gather(
dim: usize,
tensor: TchTensor<E>,
indices: TchTensor<i64>,
) -> TchTensor<E>
fn float_gather( dim: usize, tensor: TchTensor<E>, indices: TchTensor<i64>, ) -> TchTensor<E>
Gather elements from a tensor. Read more
§fn float_scatter(
dim: usize,
tensor: TchTensor<E>,
indices: TchTensor<i64>,
value: TchTensor<E>,
) -> TchTensor<E>
fn float_scatter( dim: usize, tensor: TchTensor<E>, indices: TchTensor<i64>, value: TchTensor<E>, ) -> TchTensor<E>
Scatter elements into a tensor. Read more
§fn float_select(
tensor: TchTensor<E>,
dim: usize,
indices: TchTensor<i64>,
) -> TchTensor<E>
fn float_select( tensor: TchTensor<E>, dim: usize, indices: TchTensor<i64>, ) -> TchTensor<E>
Select tensor elements along the given dimension corresponding for the given indices. Read more
§fn float_select_assign(
tensor: TchTensor<E>,
dim: usize,
indices: TchTensor<i64>,
value: TchTensor<E>,
) -> TchTensor<E>
fn float_select_assign( tensor: TchTensor<E>, dim: usize, indices: TchTensor<i64>, value: TchTensor<E>, ) -> TchTensor<E>
Assign the selected elements along the given dimension corresponding for the given indices
to the given value. Read more
§fn float_slice(tensor: TchTensor<E>, ranges: &[Range<usize>]) -> TchTensor<E>
fn float_slice(tensor: TchTensor<E>, ranges: &[Range<usize>]) -> TchTensor<E>
Select tensor elements corresponding for the given ranges. Read more
§fn float_slice_assign(
tensor: TchTensor<E>,
ranges: &[Range<usize>],
value: TchTensor<E>,
) -> TchTensor<E>
fn float_slice_assign( tensor: TchTensor<E>, ranges: &[Range<usize>], value: TchTensor<E>, ) -> TchTensor<E>
Assign the selected elements corresponding for the given ranges to the given value. Read more
§fn float_mask_where(
tensor: TchTensor<E>,
mask: TchTensor<bool>,
value: TchTensor<E>,
) -> TchTensor<E>
fn float_mask_where( tensor: TchTensor<E>, mask: TchTensor<bool>, value: TchTensor<E>, ) -> TchTensor<E>
Update the given tensor with the value tensor where the mask is true. Read more
§fn float_mask_fill(
tensor: TchTensor<E>,
mask: TchTensor<bool>,
value: E,
) -> TchTensor<E>
fn float_mask_fill( tensor: TchTensor<E>, mask: TchTensor<bool>, value: E, ) -> TchTensor<E>
Update the given tensor with the value where the mask is true. Read more
§fn float_equal(lhs: TchTensor<E>, rhs: TchTensor<E>) -> TchTensor<bool>
fn float_equal(lhs: TchTensor<E>, rhs: TchTensor<E>) -> TchTensor<bool>
Equal comparison of two tensors. Read more
§fn float_equal_elem(lhs: TchTensor<E>, rhs: E) -> TchTensor<bool>
fn float_equal_elem(lhs: TchTensor<E>, rhs: E) -> TchTensor<bool>
Equal comparison of a tensor and a scalar. Read more
§fn float_greater(lhs: TchTensor<E>, rhs: TchTensor<E>) -> TchTensor<bool>
fn float_greater(lhs: TchTensor<E>, rhs: TchTensor<E>) -> TchTensor<bool>
Greater than comparison of two tensors. Read more
§fn float_greater_elem(lhs: TchTensor<E>, rhs: E) -> TchTensor<bool>
fn float_greater_elem(lhs: TchTensor<E>, rhs: E) -> TchTensor<bool>
Greater than comparison of a tensor and a scalar. Read more
§fn float_greater_equal(lhs: TchTensor<E>, rhs: TchTensor<E>) -> TchTensor<bool>
fn float_greater_equal(lhs: TchTensor<E>, rhs: TchTensor<E>) -> TchTensor<bool>
Greater than or equal comparison of two tensors. Read more
§fn float_greater_equal_elem(lhs: TchTensor<E>, rhs: E) -> TchTensor<bool>
fn float_greater_equal_elem(lhs: TchTensor<E>, rhs: E) -> TchTensor<bool>
Greater than or equal comparison of a tensor and a scalar. Read more
§fn float_lower(lhs: TchTensor<E>, rhs: TchTensor<E>) -> TchTensor<bool>
fn float_lower(lhs: TchTensor<E>, rhs: TchTensor<E>) -> TchTensor<bool>
Less than comparison of two tensors. Read more
§fn float_lower_elem(lhs: TchTensor<E>, rhs: E) -> TchTensor<bool>
fn float_lower_elem(lhs: TchTensor<E>, rhs: E) -> TchTensor<bool>
Less than comparison of a tensor and a scalar. Read more
§fn float_lower_equal(lhs: TchTensor<E>, rhs: TchTensor<E>) -> TchTensor<bool>
fn float_lower_equal(lhs: TchTensor<E>, rhs: TchTensor<E>) -> TchTensor<bool>
Less than or equal comparison of two tensors. Read more
§fn float_lower_equal_elem(lhs: TchTensor<E>, rhs: E) -> TchTensor<bool>
fn float_lower_equal_elem(lhs: TchTensor<E>, rhs: E) -> TchTensor<bool>
Less than or equal comparison of a tensor and a scalar. Read more
§fn float_mean(tensor: TchTensor<E>) -> TchTensor<E>
fn float_mean(tensor: TchTensor<E>) -> TchTensor<E>
Mean of all elements in a tensor. Read more
§fn float_sum_dim(tensor: TchTensor<E>, dim: usize) -> TchTensor<E>
fn float_sum_dim(tensor: TchTensor<E>, dim: usize) -> TchTensor<E>
Sum of all elements in a tensor along a dimension. Read more
§fn float_mean_dim(tensor: TchTensor<E>, dim: usize) -> TchTensor<E>
fn float_mean_dim(tensor: TchTensor<E>, dim: usize) -> TchTensor<E>
Mean of all elements in a tensor along a dimension. Read more
§fn float_prod(tensor: TchTensor<E>) -> TchTensor<E>
fn float_prod(tensor: TchTensor<E>) -> TchTensor<E>
Product of all elements in a tensor. Read more
§fn float_prod_dim(tensor: TchTensor<E>, dim: usize) -> TchTensor<E>
fn float_prod_dim(tensor: TchTensor<E>, dim: usize) -> TchTensor<E>
Product of all elements in a tensor along a dimension. Read more
§fn float_argmax(tensor: TchTensor<E>, dim: usize) -> TchTensor<i64>
fn float_argmax(tensor: TchTensor<E>, dim: usize) -> TchTensor<i64>
Gets the indices of the maximum elements of a tensor along an axis. Read more
§fn float_argmin(tensor: TchTensor<E>, dim: usize) -> TchTensor<i64>
fn float_argmin(tensor: TchTensor<E>, dim: usize) -> TchTensor<i64>
Gets the indices of the minimum elements of a tensor along an axis. Read more
§fn float_max_dim(tensor: TchTensor<E>, dim: usize) -> TchTensor<E>
fn float_max_dim(tensor: TchTensor<E>, dim: usize) -> TchTensor<E>
Gets the maximum elements of a tensor along an axis. Read more
§fn float_max_dim_with_indices(
tensor: TchTensor<E>,
dim: usize,
) -> (TchTensor<E>, TchTensor<i64>)
fn float_max_dim_with_indices( tensor: TchTensor<E>, dim: usize, ) -> (TchTensor<E>, TchTensor<i64>)
Gets the maximum elements of a tensor along an axis and their indices. Read more
§fn float_min_dim(tensor: TchTensor<E>, dim: usize) -> TchTensor<E>
fn float_min_dim(tensor: TchTensor<E>, dim: usize) -> TchTensor<E>
Gets the minimum elements of a tensor along an axis. Read more
§fn float_min_dim_with_indices(
tensor: TchTensor<E>,
dim: usize,
) -> (TchTensor<E>, TchTensor<i64>)
fn float_min_dim_with_indices( tensor: TchTensor<E>, dim: usize, ) -> (TchTensor<E>, TchTensor<i64>)
Gets the minimum elements of a tensor along an axis and their indices. Read more
§fn float_exp(tensor: TchTensor<E>) -> TchTensor<E>
fn float_exp(tensor: TchTensor<E>) -> TchTensor<E>
Returns a new tensor with exponential values. Read more
§fn float_log(tensor: TchTensor<E>) -> TchTensor<E>
fn float_log(tensor: TchTensor<E>) -> TchTensor<E>
Returns a new tensor with natural logarithm values. Read more
§fn float_log1p(tensor: TchTensor<E>) -> TchTensor<E>
fn float_log1p(tensor: TchTensor<E>) -> TchTensor<E>
Returns a new tensor with logarithm values of (1 + Xi). Read more
§fn float_powf_scalar(tensor: TchTensor<E>, value: f32) -> TchTensor<E>
fn float_powf_scalar(tensor: TchTensor<E>, value: f32) -> TchTensor<E>
Returns a new tensor with values raised to the power of float
value
. Read more§fn float_sqrt(tensor: TchTensor<E>) -> TchTensor<E>
fn float_sqrt(tensor: TchTensor<E>) -> TchTensor<E>
Returns a new tensor with square root values. Read more
§fn float_abs(tensor: TchTensor<E>) -> TchTensor<E>
fn float_abs(tensor: TchTensor<E>) -> TchTensor<E>
Returns a new tensor with absolute values. Read more
§fn float_cos(tensor: TchTensor<E>) -> TchTensor<E>
fn float_cos(tensor: TchTensor<E>) -> TchTensor<E>
Returns a new tensor with cosine values. Read more
§fn float_tanh(tensor: TchTensor<E>) -> TchTensor<E>
fn float_tanh(tensor: TchTensor<E>) -> TchTensor<E>
Returns a new tensor with tangent values. Read more
§fn float_round(tensor: TchTensor<E>) -> TchTensor<E>
fn float_round(tensor: TchTensor<E>) -> TchTensor<E>
Returns a new tensor with rounded values. Read more
§fn float_floor(tensor: TchTensor<E>) -> TchTensor<E>
fn float_floor(tensor: TchTensor<E>) -> TchTensor<E>
Returns a new tensor with floored values. Read more
§fn float_ceil(tensor: TchTensor<E>) -> TchTensor<E>
fn float_ceil(tensor: TchTensor<E>) -> TchTensor<E>
Returns a new tensor with ceiled values. Read more
§fn float_erf(tensor: TchTensor<E>) -> TchTensor<E>
fn float_erf(tensor: TchTensor<E>) -> TchTensor<E>
Returns a new tensor with the error function values. Read more
§fn float_cat(tensors: Vec<TchTensor<E>>, dim: usize) -> TchTensor<E>
fn float_cat(tensors: Vec<TchTensor<E>>, dim: usize) -> TchTensor<E>
Concatenates tensors along a dimension. Read more
§fn float_clamp_min(tensor: TchTensor<E>, min: E) -> TchTensor<E>
fn float_clamp_min(tensor: TchTensor<E>, min: E) -> TchTensor<E>
Clamps a tensor under a minimum value. Read more
§fn float_clamp_max(
tensor: TchTensor<E>,
max: <LibTorch<E> as Backend>::FloatElem,
) -> TchTensor<E>
fn float_clamp_max( tensor: TchTensor<E>, max: <LibTorch<E> as Backend>::FloatElem, ) -> TchTensor<E>
Clamps a tensor over a maximum value. Read more
§fn float_clamp(
tensor: TchTensor<E>,
min: <LibTorch<E> as Backend>::FloatElem,
max: <LibTorch<E> as Backend>::FloatElem,
) -> TchTensor<E>
fn float_clamp( tensor: TchTensor<E>, min: <LibTorch<E> as Backend>::FloatElem, max: <LibTorch<E> as Backend>::FloatElem, ) -> TchTensor<E>
Clamps a tensor between a minimum and maximum value. Read more
§fn float_into_int(tensor: TchTensor<E>) -> TchTensor<i64>
fn float_into_int(tensor: TchTensor<E>) -> TchTensor<i64>
Converts float tensor to int tensor. Read more
§fn float_narrow(
tensor: TchTensor<E>,
dim: usize,
start: usize,
length: usize,
) -> TchTensor<E>
fn float_narrow( tensor: TchTensor<E>, dim: usize, start: usize, length: usize, ) -> TchTensor<E>
Returns a new tensor with the given dimension narrowed to the given range. Read more
§fn float_chunk(
tensor: TchTensor<E>,
chunks: usize,
dim: usize,
) -> Vec<TchTensor<E>>
fn float_chunk( tensor: TchTensor<E>, chunks: usize, dim: usize, ) -> Vec<TchTensor<E>>
Split the tensor along the given dimension into chunks. Read more
§fn float_powf(lhs: TchTensor<E>, rhs: TchTensor<E>) -> TchTensor<E>
fn float_powf(lhs: TchTensor<E>, rhs: TchTensor<E>) -> TchTensor<E>
Element-wise power with a FloatTensor. Read more
§fn float_permute(tensor: TchTensor<E>, axes: &[usize]) -> TchTensor<E>
fn float_permute(tensor: TchTensor<E>, axes: &[usize]) -> TchTensor<E>
Permutes the dimensions of a tensor. Read more
§fn float_flip(tensor: TchTensor<E>, axes: &[usize]) -> TchTensor<E>
fn float_flip(tensor: TchTensor<E>, axes: &[usize]) -> TchTensor<E>
Reverse the order of elements in a tensor along the given axes. Read more
§fn float_sign(tensor: TchTensor<E>) -> TchTensor<E>
fn float_sign(tensor: TchTensor<E>) -> TchTensor<E>
Returns the signs of the float
tensor
. Read more§fn float_expand(tensor: TchTensor<E>, shape: Shape) -> TchTensor<E>
fn float_expand(tensor: TchTensor<E>, shape: Shape) -> TchTensor<E>
Broadcasts the float
tensor
to the given shape
.§fn float_sort(
tensor: TchTensor<E>,
dim: usize,
descending: bool,
) -> TchTensor<E>
fn float_sort( tensor: TchTensor<E>, dim: usize, descending: bool, ) -> TchTensor<E>
Sort the elements of the input
tensor
by value in along a given dimension. Read more§fn float_sort_with_indices(
tensor: TchTensor<E>,
dim: usize,
descending: bool,
) -> (TchTensor<E>, TchTensor<i64>)
fn float_sort_with_indices( tensor: TchTensor<E>, dim: usize, descending: bool, ) -> (TchTensor<E>, TchTensor<i64>)
Sort the elements of the input
tensor
by value in along a given dimension. Read more§fn float_argsort(
tensor: TchTensor<E>,
dim: usize,
descending: bool,
) -> <LibTorch<E, Q> as Backend>::IntTensorPrimitive
fn float_argsort( tensor: TchTensor<E>, dim: usize, descending: bool, ) -> <LibTorch<E, Q> as Backend>::IntTensorPrimitive
Returns the indices that sort the elements of the input
tensor
by value along a given dimension. Read more§fn float_full(
shape: Shape,
fill_value: <B as Backend>::FloatElem,
device: &<B as Backend>::Device,
) -> <B as Backend>::FloatTensorPrimitive
fn float_full( shape: Shape, fill_value: <B as Backend>::FloatElem, device: &<B as Backend>::Device, ) -> <B as Backend>::FloatTensorPrimitive
Creates a tensor filled with given value. Read more
§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
§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
§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
§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.
§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.§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.§fn float_into_full_precision(
tensor: <B as Backend>::FloatTensorPrimitive,
) -> <<<B as Backend>::FullPrecisionBridge as BackendBridge<B>>::Target as Backend>::FloatTensorPrimitive
fn float_into_full_precision( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <<<B as Backend>::FullPrecisionBridge as BackendBridge<B>>::Target as Backend>::FloatTensorPrimitive
Converts a tensor to full precision. Read more
§fn float_from_full_precision(
tensor: <<<B as Backend>::FullPrecisionBridge as BackendBridge<B>>::Target as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn float_from_full_precision( tensor: <<<B as Backend>::FullPrecisionBridge as BackendBridge<B>>::Target as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
Converts a tensor from full precision. Read more
§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
§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
§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
§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
§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 more§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
§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 more§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
§impl<E, Q> IntTensorOps<LibTorch<E, Q>> for LibTorch<E, Q>where
E: TchElement,
Q: QuantElement,
impl<E, Q> IntTensorOps<LibTorch<E, Q>> for LibTorch<E, Q>where
E: TchElement,
Q: QuantElement,
§fn int_from_data(data: TensorData, device: &LibTorchDevice) -> TchTensor<i64>
fn int_from_data(data: TensorData, device: &LibTorchDevice) -> TchTensor<i64>
Creates a tensor from the data structure. Read more
§fn int_repeat_dim(
tensor: TchTensor<i64>,
dim: usize,
times: usize,
) -> TchTensor<i64>
fn int_repeat_dim( tensor: TchTensor<i64>, dim: usize, times: usize, ) -> TchTensor<i64>
Repeats the tensor along the given dimension the given number of times. Read more
§async fn int_into_data(tensor: TchTensor<i64>) -> TensorData
async fn int_into_data(tensor: TchTensor<i64>) -> TensorData
Converts the tensor to a data structure. Read more
§fn int_to_device(
tensor: TchTensor<i64>,
device: &LibTorchDevice,
) -> TchTensor<i64>
fn int_to_device( tensor: TchTensor<i64>, device: &LibTorchDevice, ) -> TchTensor<i64>
Moves the tensor to the given device.
§fn int_reshape(tensor: TchTensor<i64>, shape: Shape) -> TchTensor<i64>
fn int_reshape(tensor: TchTensor<i64>, shape: Shape) -> TchTensor<i64>
Reshapes the tensor. Read more
§fn int_device(tensor: &TchTensor<i64>) -> LibTorchDevice
fn int_device(tensor: &TchTensor<i64>) -> LibTorchDevice
Gets the device of the tensor. Read more
§fn int_empty(
shape: Shape,
device: &<LibTorch<E> as Backend>::Device,
) -> TchTensor<i64>
fn int_empty( shape: Shape, device: &<LibTorch<E> as Backend>::Device, ) -> TchTensor<i64>
Creates a new int tensor. Read more
§fn int_slice(tensor: TchTensor<i64>, ranges: &[Range<usize>]) -> TchTensor<i64>
fn int_slice(tensor: TchTensor<i64>, ranges: &[Range<usize>]) -> TchTensor<i64>
Gets the element at the given indices. Read more
§fn int_slice_assign(
tensor: TchTensor<i64>,
ranges: &[Range<usize>],
value: TchTensor<i64>,
) -> TchTensor<i64>
fn int_slice_assign( tensor: TchTensor<i64>, ranges: &[Range<usize>], value: TchTensor<i64>, ) -> TchTensor<i64>
Sets the element at the given indices. Read more
§fn int_cat(tensors: Vec<TchTensor<i64>>, dim: usize) -> TchTensor<i64>
fn int_cat(tensors: Vec<TchTensor<i64>>, dim: usize) -> TchTensor<i64>
Concatenates the given tensors along the given dimension. Read more
§fn int_equal(lhs: TchTensor<i64>, rhs: TchTensor<i64>) -> TchTensor<bool>
fn int_equal(lhs: TchTensor<i64>, rhs: TchTensor<i64>) -> TchTensor<bool>
Element-wise equality comparison. Read more
§fn int_equal_elem(lhs: TchTensor<i64>, rhs: i64) -> TchTensor<bool>
fn int_equal_elem(lhs: TchTensor<i64>, rhs: i64) -> TchTensor<bool>
Element-wise equality comparison with a scalar. Read more
§fn int_greater(lhs: TchTensor<i64>, rhs: TchTensor<i64>) -> TchTensor<bool>
fn int_greater(lhs: TchTensor<i64>, rhs: TchTensor<i64>) -> TchTensor<bool>
Element-wise greater than comparison. Read more
§fn int_greater_elem(lhs: TchTensor<i64>, rhs: i64) -> TchTensor<bool>
fn int_greater_elem(lhs: TchTensor<i64>, rhs: i64) -> TchTensor<bool>
Element-wise greater than comparison with a scalar. Read more
§fn int_greater_equal(
lhs: TchTensor<i64>,
rhs: TchTensor<i64>,
) -> TchTensor<bool>
fn int_greater_equal( lhs: TchTensor<i64>, rhs: TchTensor<i64>, ) -> TchTensor<bool>
Element-wise greater than or equal comparison. Read more
§fn int_greater_equal_elem(lhs: TchTensor<i64>, rhs: i64) -> TchTensor<bool>
fn int_greater_equal_elem(lhs: TchTensor<i64>, rhs: i64) -> TchTensor<bool>
Element-wise greater than or equal comparison with a scalar. Read more
§fn int_lower(lhs: TchTensor<i64>, rhs: TchTensor<i64>) -> TchTensor<bool>
fn int_lower(lhs: TchTensor<i64>, rhs: TchTensor<i64>) -> TchTensor<bool>
Element-wise less than comparison. Read more
§fn int_lower_elem(lhs: TchTensor<i64>, rhs: i64) -> TchTensor<bool>
fn int_lower_elem(lhs: TchTensor<i64>, rhs: i64) -> TchTensor<bool>
Element-wise less than comparison with a scalar. Read more
§fn int_lower_equal(lhs: TchTensor<i64>, rhs: TchTensor<i64>) -> TchTensor<bool>
fn int_lower_equal(lhs: TchTensor<i64>, rhs: TchTensor<i64>) -> TchTensor<bool>
Element-wise less than or equal comparison. Read more
§fn int_lower_equal_elem(lhs: TchTensor<i64>, rhs: i64) -> TchTensor<bool>
fn int_lower_equal_elem(lhs: TchTensor<i64>, rhs: i64) -> TchTensor<bool>
Element-wise less than or equal comparison with a scalar. Read more
§fn int_add(lhs: TchTensor<i64>, rhs: TchTensor<i64>) -> TchTensor<i64>
fn int_add(lhs: TchTensor<i64>, rhs: TchTensor<i64>) -> TchTensor<i64>
Element-wise addition. Read more
§fn int_add_scalar(lhs: TchTensor<i64>, rhs: i64) -> TchTensor<i64>
fn int_add_scalar(lhs: TchTensor<i64>, rhs: i64) -> TchTensor<i64>
Element-wise addition with a scalar. Read more
§fn int_sub(lhs: TchTensor<i64>, rhs: TchTensor<i64>) -> TchTensor<i64>
fn int_sub(lhs: TchTensor<i64>, rhs: TchTensor<i64>) -> TchTensor<i64>
Element-wise subtraction. Read more
§fn int_sub_scalar(lhs: TchTensor<i64>, rhs: i64) -> TchTensor<i64>
fn int_sub_scalar(lhs: TchTensor<i64>, rhs: i64) -> TchTensor<i64>
Element-wise subtraction with a scalar. Read more
§fn int_mul(lhs: TchTensor<i64>, rhs: TchTensor<i64>) -> TchTensor<i64>
fn int_mul(lhs: TchTensor<i64>, rhs: TchTensor<i64>) -> TchTensor<i64>
Element-wise multiplication. Read more
§fn int_mul_scalar(lhs: TchTensor<i64>, rhs: i64) -> TchTensor<i64>
fn int_mul_scalar(lhs: TchTensor<i64>, rhs: i64) -> TchTensor<i64>
Element-wise multiplication with a scalar. Read more
§fn int_div(lhs: TchTensor<i64>, rhs: TchTensor<i64>) -> TchTensor<i64>
fn int_div(lhs: TchTensor<i64>, rhs: TchTensor<i64>) -> TchTensor<i64>
Element-wise division. Read more
§fn int_div_scalar(lhs: TchTensor<i64>, rhs: i64) -> TchTensor<i64>
fn int_div_scalar(lhs: TchTensor<i64>, rhs: i64) -> TchTensor<i64>
Element-wise division with a scalar. Read more
§fn int_remainder_scalar(lhs: TchTensor<i64>, rhs: i64) -> TchTensor<i64>
fn int_remainder_scalar(lhs: TchTensor<i64>, rhs: i64) -> TchTensor<i64>
Element-wise modulus with a scalar. Read more
§fn int_zeros(
shape: Shape,
device: &<LibTorch<E> as Backend>::Device,
) -> TchTensor<i64>
fn int_zeros( shape: Shape, device: &<LibTorch<E> as Backend>::Device, ) -> TchTensor<i64>
Creates a tensor of zeros. Read more
§fn int_ones(
shape: Shape,
device: &<LibTorch<E> as Backend>::Device,
) -> TchTensor<i64>
fn int_ones( shape: Shape, device: &<LibTorch<E> as Backend>::Device, ) -> TchTensor<i64>
Creates a tensor of ones. Read more
§fn int_full(
shape: Shape,
fill_value: i64,
device: &<LibTorch<E> as Backend>::Device,
) -> TchTensor<i64>
fn int_full( shape: Shape, fill_value: i64, device: &<LibTorch<E> as Backend>::Device, ) -> TchTensor<i64>
Creates a tensor filled with given value. Read more
§fn int_sum_dim(tensor: TchTensor<i64>, dim: usize) -> TchTensor<i64>
fn int_sum_dim(tensor: TchTensor<i64>, dim: usize) -> TchTensor<i64>
Sums all elements in the tensor along a dimension. Read more
§fn int_prod(tensor: TchTensor<i64>) -> TchTensor<i64>
fn int_prod(tensor: TchTensor<i64>) -> TchTensor<i64>
Computes the product of all elements in the tensor. Read more
§fn int_prod_dim(tensor: TchTensor<i64>, dim: usize) -> TchTensor<i64>
fn int_prod_dim(tensor: TchTensor<i64>, dim: usize) -> TchTensor<i64>
Computes the product of all elements in the tensor along a dimension. Read more
§fn int_mean(tensor: TchTensor<i64>) -> TchTensor<i64>
fn int_mean(tensor: TchTensor<i64>) -> TchTensor<i64>
Computes the mean of all elements in the tensor. Read more
§fn int_mean_dim(tensor: TchTensor<i64>, dim: usize) -> TchTensor<i64>
fn int_mean_dim(tensor: TchTensor<i64>, dim: usize) -> TchTensor<i64>
Computes the mean of all elements in the tensor along a dimension. Read more
§fn int_gather(
dim: usize,
tensor: TchTensor<i64>,
indices: TchTensor<i64>,
) -> TchTensor<i64>
fn int_gather( dim: usize, tensor: TchTensor<i64>, indices: TchTensor<i64>, ) -> TchTensor<i64>
Gather elements from the tensor at the given indices. Read more
§fn int_scatter(
dim: usize,
tensor: TchTensor<i64>,
indices: TchTensor<i64>,
value: TchTensor<i64>,
) -> TchTensor<i64>
fn int_scatter( dim: usize, tensor: TchTensor<i64>, indices: TchTensor<i64>, value: TchTensor<i64>, ) -> TchTensor<i64>
Scatter a given value to the tensor at the given indices. Read more
§fn int_select(
tensor: TchTensor<i64>,
dim: usize,
indices: TchTensor<i64>,
) -> TchTensor<i64>
fn int_select( tensor: TchTensor<i64>, dim: usize, indices: TchTensor<i64>, ) -> TchTensor<i64>
Select tensor elements along the given dimension corresponding to the given indices. Read more
§fn int_select_assign(
tensor: TchTensor<i64>,
dim: usize,
indices: TchTensor<i64>,
value: TchTensor<i64>,
) -> TchTensor<i64>
fn int_select_assign( tensor: TchTensor<i64>, dim: usize, indices: TchTensor<i64>, value: TchTensor<i64>, ) -> TchTensor<i64>
Assign the selected elements along the given dimension corresponding to the given indices
to the given value. Read more
§fn int_mask_where(
tensor: TchTensor<i64>,
mask: TchTensor<bool>,
source: TchTensor<i64>,
) -> TchTensor<i64>
fn int_mask_where( tensor: TchTensor<i64>, mask: TchTensor<bool>, source: TchTensor<i64>, ) -> TchTensor<i64>
Fills the tensor with values from the source tensor if the mask is true at the given
indices. Read more
§fn int_mask_fill(
tensor: TchTensor<i64>,
mask: TchTensor<bool>,
value: i64,
) -> TchTensor<i64>
fn int_mask_fill( tensor: TchTensor<i64>, mask: TchTensor<bool>, value: i64, ) -> TchTensor<i64>
Fills the tensor with the given value if the mask is true at the given indices. Read more
§fn int_argmax(tensor: TchTensor<i64>, dim: usize) -> TchTensor<i64>
fn int_argmax(tensor: TchTensor<i64>, dim: usize) -> TchTensor<i64>
Gets the indices of the maximum elements along a dimension. Read more
§fn int_argmin(tensor: TchTensor<i64>, dim: usize) -> TchTensor<i64>
fn int_argmin(tensor: TchTensor<i64>, dim: usize) -> TchTensor<i64>
Gets the indices of the minimum elements along a dimension. Read more
§fn int_max_dim(tensor: TchTensor<i64>, dim: usize) -> TchTensor<i64>
fn int_max_dim(tensor: TchTensor<i64>, dim: usize) -> TchTensor<i64>
Gets the maximum element in the tensor along a dimension. Read more
§fn int_max_dim_with_indices(
tensor: TchTensor<i64>,
dim: usize,
) -> (TchTensor<i64>, TchTensor<i64>)
fn int_max_dim_with_indices( tensor: TchTensor<i64>, dim: usize, ) -> (TchTensor<i64>, TchTensor<i64>)
Gets the maximum elements and corresponding indices along a dimension. Read more
§fn int_min_dim(tensor: TchTensor<i64>, dim: usize) -> TchTensor<i64>
fn int_min_dim(tensor: TchTensor<i64>, dim: usize) -> TchTensor<i64>
Gets the minimum elements in the tensor along a dimension. Read more
§fn int_min_dim_with_indices(
tensor: TchTensor<i64>,
dim: usize,
) -> (TchTensor<i64>, TchTensor<i64>)
fn int_min_dim_with_indices( tensor: TchTensor<i64>, dim: usize, ) -> (TchTensor<i64>, TchTensor<i64>)
Gets the minimum elements and corresponding indices along a dimension. Read more
§fn int_clamp_min(tensor: TchTensor<i64>, min: i64) -> TchTensor<i64>
fn int_clamp_min(tensor: TchTensor<i64>, min: i64) -> TchTensor<i64>
Clamps a tensor under a minimum value. Read more
§fn int_clamp_max(tensor: TchTensor<i64>, max: i64) -> TchTensor<i64>
fn int_clamp_max(tensor: TchTensor<i64>, max: i64) -> TchTensor<i64>
Clamps a tensor over a maximum value. Read more
§fn int_clamp(tensor: TchTensor<i64>, min: i64, max: i64) -> TchTensor<i64>
fn int_clamp(tensor: TchTensor<i64>, min: i64, max: i64) -> TchTensor<i64>
Clamps a tensor between a minimum and maximum value. Read more
§fn int_abs(tensor: TchTensor<i64>) -> TchTensor<i64>
fn int_abs(tensor: TchTensor<i64>) -> TchTensor<i64>
Returns a new tensor with absolute values. Read more
§fn int_into_float(tensor: TchTensor<i64>) -> TchTensor<E>
fn int_into_float(tensor: TchTensor<i64>) -> TchTensor<E>
Converts int tensor to float tensor. Read more
§fn int_swap_dims(
tensor: <LibTorch<E, Q> as Backend>::IntTensorPrimitive,
dim1: usize,
dim2: usize,
) -> <LibTorch<E, Q> as Backend>::IntTensorPrimitive
fn int_swap_dims( tensor: <LibTorch<E, Q> as Backend>::IntTensorPrimitive, dim1: usize, dim2: usize, ) -> <LibTorch<E, Q> as Backend>::IntTensorPrimitive
Swaps two dimensions of an int tensor. Read more
§fn int_narrow(
tensor: TchTensor<i64>,
dim: usize,
start: usize,
length: usize,
) -> TchTensor<i64>
fn int_narrow( tensor: TchTensor<i64>, dim: usize, start: usize, length: usize, ) -> TchTensor<i64>
Returns a new tensor with the given dimension narrowed to the given range. Read more
§fn int_chunk(
tensor: TchTensor<i64>,
chunks: usize,
dim: usize,
) -> Vec<TchTensor<i64>>
fn int_chunk( tensor: TchTensor<i64>, chunks: usize, dim: usize, ) -> Vec<TchTensor<i64>>
Split the tensor along the given dimension into chunks. Read more
§fn int_random(
shape: Shape,
distribution: Distribution,
device: &LibTorchDevice,
) -> TchTensor<i64>
fn int_random( shape: Shape, distribution: Distribution, device: &LibTorchDevice, ) -> TchTensor<i64>
Creates a new int tensor with random values. Read more
§fn int_arange(range: Range<i64>, device: &LibTorchDevice) -> TchTensor<i64>
fn int_arange(range: Range<i64>, device: &LibTorchDevice) -> TchTensor<i64>
Creates a new tensor with values from the given range. Read more
§fn int_permute(
tensor: <LibTorch<E, Q> as Backend>::IntTensorPrimitive,
axes: &[usize],
) -> <LibTorch<E, Q> as Backend>::IntTensorPrimitive
fn int_permute( tensor: <LibTorch<E, Q> as Backend>::IntTensorPrimitive, axes: &[usize], ) -> <LibTorch<E, Q> as Backend>::IntTensorPrimitive
Permutes the dimensions of a tensor. Read more
§fn int_flip(
tensor: <LibTorch<E, Q> as Backend>::IntTensorPrimitive,
axes: &[usize],
) -> <LibTorch<E, Q> as Backend>::IntTensorPrimitive
fn int_flip( tensor: <LibTorch<E, Q> as Backend>::IntTensorPrimitive, axes: &[usize], ) -> <LibTorch<E, Q> as Backend>::IntTensorPrimitive
Reverse the order of elements in a tensor along the given axes. Read more
§fn int_sign(
tensor: <LibTorch<E, Q> as Backend>::IntTensorPrimitive,
) -> <LibTorch<E, Q> as Backend>::IntTensorPrimitive
fn int_sign( tensor: <LibTorch<E, Q> as Backend>::IntTensorPrimitive, ) -> <LibTorch<E, Q> as Backend>::IntTensorPrimitive
Returns the signs of the int
tensor
. Read more§fn int_expand(
tensor: <LibTorch<E, Q> as Backend>::IntTensorPrimitive,
shape: Shape,
) -> <LibTorch<E, Q> as Backend>::IntTensorPrimitive
fn int_expand( tensor: <LibTorch<E, Q> as Backend>::IntTensorPrimitive, shape: Shape, ) -> <LibTorch<E, Q> as Backend>::IntTensorPrimitive
Broadcasts the int
tensor
to the given shape
.§fn int_sort(
tensor: <LibTorch<E, Q> as Backend>::IntTensorPrimitive,
dim: usize,
descending: bool,
) -> <LibTorch<E, Q> as Backend>::IntTensorPrimitive
fn int_sort( tensor: <LibTorch<E, Q> as Backend>::IntTensorPrimitive, dim: usize, descending: bool, ) -> <LibTorch<E, Q> as Backend>::IntTensorPrimitive
Sort the elements of the input
tensor
by value along a given dimension. Read more§fn int_argsort(
tensor: <LibTorch<E, Q> as Backend>::IntTensorPrimitive,
dim: usize,
descending: bool,
) -> <LibTorch<E, Q> as Backend>::IntTensorPrimitive
fn int_argsort( tensor: <LibTorch<E, Q> as Backend>::IntTensorPrimitive, dim: usize, descending: bool, ) -> <LibTorch<E, Q> as Backend>::IntTensorPrimitive
Returns the indices that sort the elements of the input
tensor
by value
along a given dimension. Read more§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
§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
§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
§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
§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
§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
§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
§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
§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
§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
§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 more§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
§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 more§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
§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 more§impl<E, Q> ModuleOps<LibTorch<E, Q>> for LibTorch<E, Q>where
E: TchElement,
Q: QuantElement,
impl<E, Q> ModuleOps<LibTorch<E, Q>> for LibTorch<E, Q>where
E: TchElement,
Q: QuantElement,
§fn embedding(weights: TchTensor<E>, indices: TchTensor<i64>) -> TchTensor<E>
fn embedding(weights: TchTensor<E>, indices: TchTensor<i64>) -> TchTensor<E>
Embedding operation. Read more
§fn embedding_backward(
weights: TchTensor<E>,
output: TchTensor<E>,
indices: TchTensor<i64>,
) -> TchTensor<E>
fn embedding_backward( weights: TchTensor<E>, output: TchTensor<E>, indices: TchTensor<i64>, ) -> TchTensor<E>
Embedding backward operation. Read more
§fn conv1d(
x: TchTensor<E>,
weight: TchTensor<E>,
bias: Option<TchTensor<E>>,
options: ConvOptions<1>,
) -> TchTensor<E>
fn conv1d( x: TchTensor<E>, weight: TchTensor<E>, bias: Option<TchTensor<E>>, options: ConvOptions<1>, ) -> TchTensor<E>
One dimensional convolution. Read more
§fn conv2d(
x: TchTensor<E>,
weight: TchTensor<E>,
bias: Option<TchTensor<E>>,
options: ConvOptions<2>,
) -> TchTensor<E>
fn conv2d( x: TchTensor<E>, weight: TchTensor<E>, bias: Option<TchTensor<E>>, options: ConvOptions<2>, ) -> TchTensor<E>
Two dimensional convolution. Read more
§fn conv3d(
x: TchTensor<E>,
weight: TchTensor<E>,
bias: Option<TchTensor<E>>,
options: ConvOptions<3>,
) -> TchTensor<E>
fn conv3d( x: TchTensor<E>, weight: TchTensor<E>, bias: Option<TchTensor<E>>, options: ConvOptions<3>, ) -> TchTensor<E>
Three dimensional convolution. Read more
§fn deform_conv2d(
_x: TchTensor<E>,
_offset: TchTensor<E>,
_weight: TchTensor<E>,
_mask: Option<TchTensor<E>>,
_bias: Option<TchTensor<E>>,
_options: DeformConvOptions<2>,
) -> TchTensor<E>
fn deform_conv2d( _x: TchTensor<E>, _offset: TchTensor<E>, _weight: TchTensor<E>, _mask: Option<TchTensor<E>>, _bias: Option<TchTensor<E>>, _options: DeformConvOptions<2>, ) -> TchTensor<E>
Two dimensional deformable convolution. Read more
§fn deform_conv2d_backward(
_x: TchTensor<E>,
_offset: TchTensor<E>,
_weight: TchTensor<E>,
_mask: Option<TchTensor<E>>,
_bias: Option<TchTensor<E>>,
_out_grad: TchTensor<E>,
_options: DeformConvOptions<2>,
) -> DeformConv2dBackward<LibTorch<E, Q>>
fn deform_conv2d_backward( _x: TchTensor<E>, _offset: TchTensor<E>, _weight: TchTensor<E>, _mask: Option<TchTensor<E>>, _bias: Option<TchTensor<E>>, _out_grad: TchTensor<E>, _options: DeformConvOptions<2>, ) -> DeformConv2dBackward<LibTorch<E, Q>>
Backward pass for the deform_conv2d operation.
§fn conv_transpose1d(
x: TchTensor<E>,
weight: TchTensor<E>,
bias: Option<TchTensor<E>>,
options: ConvTransposeOptions<1>,
) -> TchTensor<E>
fn conv_transpose1d( x: TchTensor<E>, weight: TchTensor<E>, bias: Option<TchTensor<E>>, options: ConvTransposeOptions<1>, ) -> TchTensor<E>
One dimensional transposed convolution. Read more
§fn conv_transpose2d(
x: TchTensor<E>,
weight: TchTensor<E>,
bias: Option<TchTensor<E>>,
options: ConvTransposeOptions<2>,
) -> TchTensor<E>
fn conv_transpose2d( x: TchTensor<E>, weight: TchTensor<E>, bias: Option<TchTensor<E>>, options: ConvTransposeOptions<2>, ) -> TchTensor<E>
Two dimensional transposed convolution. Read more
§fn conv_transpose3d(
x: TchTensor<E>,
weight: TchTensor<E>,
bias: Option<TchTensor<E>>,
options: ConvTransposeOptions<3>,
) -> TchTensor<E>
fn conv_transpose3d( x: TchTensor<E>, weight: TchTensor<E>, bias: Option<TchTensor<E>>, options: ConvTransposeOptions<3>, ) -> TchTensor<E>
Three dimensional transposed convolution. Read more
§fn avg_pool1d(
x: TchTensor<E>,
kernel_size: usize,
stride: usize,
padding: usize,
count_include_pad: bool,
) -> TchTensor<E>
fn avg_pool1d( x: TchTensor<E>, kernel_size: usize, stride: usize, padding: usize, count_include_pad: bool, ) -> TchTensor<E>
One dimensional avg pooling. Read more
§fn avg_pool2d(
x: TchTensor<E>,
kernel_size: [usize; 2],
stride: [usize; 2],
padding: [usize; 2],
count_include_pad: bool,
) -> TchTensor<E>
fn avg_pool2d( x: TchTensor<E>, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], count_include_pad: bool, ) -> TchTensor<E>
Two dimensional avg pooling. Read more
§fn avg_pool2d_backward(
x: TchTensor<E>,
grad: TchTensor<E>,
kernel_size: [usize; 2],
stride: [usize; 2],
padding: [usize; 2],
count_include_pad: bool,
) -> TchTensor<E>
fn avg_pool2d_backward( x: TchTensor<E>, grad: TchTensor<E>, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], count_include_pad: bool, ) -> TchTensor<E>
Backward pass for the avg pooling 2d operation.
§fn max_pool1d(
x: TchTensor<E>,
kernel_size: usize,
stride: usize,
padding: usize,
dilation: usize,
) -> TchTensor<E>
fn max_pool1d( x: TchTensor<E>, kernel_size: usize, stride: usize, padding: usize, dilation: usize, ) -> TchTensor<E>
One dimensional max pooling. Read more
§fn max_pool1d_with_indices(
x: TchTensor<E>,
kernel_size: usize,
stride: usize,
padding: usize,
dilation: usize,
) -> MaxPool1dWithIndices<LibTorch<E, Q>>
fn max_pool1d_with_indices( x: TchTensor<E>, kernel_size: usize, stride: usize, padding: usize, dilation: usize, ) -> MaxPool1dWithIndices<LibTorch<E, Q>>
One dimensional max pooling with indices. Read more
§fn max_pool2d(
x: TchTensor<E>,
kernel_size: [usize; 2],
stride: [usize; 2],
padding: [usize; 2],
dilation: [usize; 2],
) -> TchTensor<E>
fn max_pool2d( x: TchTensor<E>, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], ) -> TchTensor<E>
Two dimensional max pooling. Read more
§fn max_pool2d_with_indices(
x: TchTensor<E>,
kernel_size: [usize; 2],
stride: [usize; 2],
padding: [usize; 2],
dilation: [usize; 2],
) -> MaxPool2dWithIndices<LibTorch<E, Q>>
fn max_pool2d_with_indices( x: TchTensor<E>, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], ) -> MaxPool2dWithIndices<LibTorch<E, Q>>
Two dimensional max pooling with indices. Read more
§fn max_pool2d_with_indices_backward(
x: TchTensor<E>,
kernel_size: [usize; 2],
stride: [usize; 2],
padding: [usize; 2],
dilation: [usize; 2],
output_grad: TchTensor<E>,
indices: TchTensor<i64>,
) -> MaxPool2dBackward<LibTorch<E, Q>>
fn max_pool2d_with_indices_backward( x: TchTensor<E>, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], output_grad: TchTensor<E>, indices: TchTensor<i64>, ) -> MaxPool2dBackward<LibTorch<E, Q>>
Backward pass for the max pooling 2d operation.
§fn adaptive_avg_pool2d(x: TchTensor<E>, output_size: [usize; 2]) -> TchTensor<E>
fn adaptive_avg_pool2d(x: TchTensor<E>, output_size: [usize; 2]) -> TchTensor<E>
Two dimensional adaptive avg pooling. Read more
§fn adaptive_avg_pool2d_backward(
x: TchTensor<E>,
grad: TchTensor<E>,
) -> TchTensor<E>
fn adaptive_avg_pool2d_backward( x: TchTensor<E>, grad: TchTensor<E>, ) -> TchTensor<E>
Backward pass for the adaptive avg pooling 2d operation.
§fn adaptive_avg_pool1d(x: TchTensor<E>, output_size: usize) -> TchTensor<E>
fn adaptive_avg_pool1d(x: TchTensor<E>, output_size: usize) -> TchTensor<E>
One dimensional adaptive avg pooling. Read more
§fn interpolate(
x: TchTensor<E>,
output_size: [usize; 2],
options: InterpolateOptions,
) -> TchTensor<E>
fn interpolate( x: TchTensor<E>, output_size: [usize; 2], options: InterpolateOptions, ) -> TchTensor<E>
Down/up samples the input. Read more
§fn interpolate_backward(
x: TchTensor<E>,
grad: TchTensor<E>,
output_size: [usize; 2],
options: InterpolateOptions,
) -> TchTensor<E>
fn interpolate_backward( x: TchTensor<E>, grad: TchTensor<E>, output_size: [usize; 2], options: InterpolateOptions, ) -> TchTensor<E>
Backward pass for the interpolate operation.
§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
.§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
.§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
.§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
.§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
.§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
.§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
.§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
.§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
.§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
.§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
.§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
.§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
.§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
.§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
.§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
.§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
.§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
.§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
§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.
§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.
§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.
§impl<E, Q> QTensorOps<LibTorch<E, Q>> for LibTorch<E, Q>where
E: TchElement,
Q: QuantElement,
impl<E, Q> QTensorOps<LibTorch<E, Q>> for LibTorch<E, Q>where
E: TchElement,
Q: QuantElement,
§fn q_from_data(
data: TensorData,
device: &LibTorchDevice,
) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
fn q_from_data( data: TensorData, device: &LibTorchDevice, ) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
Creates a new tensor from the data structure. Read more
§fn quantize(
tensor: <LibTorch<E, Q> as Backend>::FloatTensorPrimitive,
scheme: &QuantizationScheme,
qparams: QuantizationParametersPrimitive<LibTorch<E, Q>>,
) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
fn quantize( tensor: <LibTorch<E, Q> as Backend>::FloatTensorPrimitive, scheme: &QuantizationScheme, qparams: QuantizationParametersPrimitive<LibTorch<E, Q>>, ) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
Convert the tensor to a lower precision data type based on the quantization scheme and parameters.
§fn quantize_dynamic(
tensor: <LibTorch<E, Q> as Backend>::FloatTensorPrimitive,
scheme: &QuantizationScheme,
) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
fn quantize_dynamic( tensor: <LibTorch<E, Q> as Backend>::FloatTensorPrimitive, scheme: &QuantizationScheme, ) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
Dynamically convert the tensor to a lower precision data type based on the quantization scheme.
§fn dequantize(
tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
) -> <LibTorch<E, Q> as Backend>::FloatTensorPrimitive
fn dequantize( tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, ) -> <LibTorch<E, Q> as Backend>::FloatTensorPrimitive
Convert the tensor back to a higher precision data type.
§fn q_shape(
tensor: &<LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
) -> Shape
fn q_shape( tensor: &<LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, ) -> Shape
Gets the shape of the tensor. Read more
§fn q_device(
tensor: &<LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
) -> LibTorchDevice
fn q_device( tensor: &<LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, ) -> LibTorchDevice
Gets the device of the tensor. Read more
§fn q_to_device(
tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
device: &<LibTorch<E, Q> as Backend>::Device,
) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
fn q_to_device( tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, device: &<LibTorch<E, Q> as Backend>::Device, ) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
Moves the tensor to the given device. Read more
§fn q_reshape(
tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
shape: Shape,
) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
fn q_reshape( tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, shape: Shape, ) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
Reshapes a tensor. Read more
§async fn q_into_data(
tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
) -> TensorData
async fn q_into_data( tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, ) -> TensorData
Converts the tensor to a data structure. Read more
§fn q_swap_dims(
tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
dim1: usize,
dim2: usize,
) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
fn q_swap_dims( tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, dim1: usize, dim2: usize, ) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
Swaps two dimensions of a tensor. Read more
§fn q_permute(
tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
axes: &[usize],
) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
fn q_permute( tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, axes: &[usize], ) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
Permutes the dimensions of a tensor. Read more
§fn q_flip(
tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
axes: &[usize],
) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
fn q_flip( tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, axes: &[usize], ) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
Reverse the order of elements in a tensor along the given axes. Read more
§fn q_select(
tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
dim: usize,
indices: <LibTorch<E, Q> as Backend>::IntTensorPrimitive,
) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
fn q_select( tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, dim: usize, indices: <LibTorch<E, Q> as Backend>::IntTensorPrimitive, ) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
Select tensor elements along the given dimension corresponding for the given indices. Read more
§fn q_slice(
tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
ranges: &[Range<usize>],
) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
fn q_slice( tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, ranges: &[Range<usize>], ) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
Select tensor elements corresponding for the given ranges. Read more
§fn q_argmax(
tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
dim: usize,
) -> <LibTorch<E, Q> as Backend>::IntTensorPrimitive
fn q_argmax( tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <LibTorch<E, Q> as Backend>::IntTensorPrimitive
Gets the indices of the maximum elements of a tensor along an axis. Read more
§fn q_argmin(
tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
dim: usize,
) -> <LibTorch<E, Q> as Backend>::IntTensorPrimitive
fn q_argmin( tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <LibTorch<E, Q> as Backend>::IntTensorPrimitive
Gets the indices of the minimum elements of a tensor along an axis. Read more
§fn q_max_dim_with_indices(
tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
dim: usize,
) -> (<LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, <LibTorch<E, Q> as Backend>::IntTensorPrimitive)
fn q_max_dim_with_indices( tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> (<LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, <LibTorch<E, Q> as Backend>::IntTensorPrimitive)
Gets the maximum elements of a tensor along an axis and their indices. Read more
§fn q_max_dim(
tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
dim: usize,
) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
fn q_max_dim( tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
Gets the maximum elements of a tensor along an axis. Read more
§fn q_min_dim(
tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
dim: usize,
) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
fn q_min_dim( tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
Gets the minimum elements of a tensor along an axis. Read more
§fn q_min_dim_with_indices(
tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
dim: usize,
) -> (<LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, <LibTorch<E, Q> as Backend>::IntTensorPrimitive)
fn q_min_dim_with_indices( tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> (<LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, <LibTorch<E, Q> as Backend>::IntTensorPrimitive)
Gets the minimum elements of a tensor along an axis and their indices. Read more
§fn q_narrow(
tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
dim: usize,
start: usize,
length: usize,
) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
fn q_narrow( tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, dim: usize, start: usize, length: usize, ) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
Returns a new tensor with the given dimension narrowed to the given range. Read more
§fn q_chunk(
tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
chunks: usize,
dim: usize,
) -> Vec<<LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive>
fn q_chunk( tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, chunks: usize, dim: usize, ) -> Vec<<LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive>
Split the tensor along the given dimension into chunks. Read more
§fn q_expand(
tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
shape: Shape,
) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
fn q_expand( tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, shape: Shape, ) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
Broadcasts the
tensor
to the given shape
.§fn q_sort(
tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
dim: usize,
descending: bool,
) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
fn q_sort( tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, dim: usize, descending: bool, ) -> <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive
Sort the elements of the input
tensor
by value in along a given dimension. Read more§fn q_sort_with_indices(
tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
dim: usize,
descending: bool,
) -> (<LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, <LibTorch<E, Q> as Backend>::IntTensorPrimitive)
fn q_sort_with_indices( tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, dim: usize, descending: bool, ) -> (<LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, <LibTorch<E, Q> as Backend>::IntTensorPrimitive)
Sort the elements of the input
tensor
by value in along a given dimension. Read more§fn q_argsort(
tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive,
dim: usize,
descending: bool,
) -> <LibTorch<E, Q> as Backend>::IntTensorPrimitive
fn q_argsort( tensor: <LibTorch<E, Q> as Backend>::QuantizedTensorPrimitive, dim: usize, descending: bool, ) -> <LibTorch<E, Q> as Backend>::IntTensorPrimitive
Returns the indices that sort the elements of the input
tensor
by value along a given dimension. Read more§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.
§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.§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.§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
§fn q_add(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_add( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Adds two tensors together. Read more
§fn q_add_scalar(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::FloatElem,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_add_scalar( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> <B as Backend>::QuantizedTensorPrimitive
Adds a scalar to a tensor. Read more
§fn q_clamp_min(
tensor: <B as Backend>::QuantizedTensorPrimitive,
min: <B as Backend>::FloatElem,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_clamp_min( tensor: <B as Backend>::QuantizedTensorPrimitive, min: <B as Backend>::FloatElem, ) -> <B as Backend>::QuantizedTensorPrimitive
Clamps a tensor under a minimum value. Read more
§fn q_clamp_max(
tensor: <B as Backend>::QuantizedTensorPrimitive,
max: <B as Backend>::FloatElem,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_clamp_max( tensor: <B as Backend>::QuantizedTensorPrimitive, max: <B as Backend>::FloatElem, ) -> <B as Backend>::QuantizedTensorPrimitive
Clamps a tensor over a maximum value. Read more
§fn q_clamp(
tensor: <B as Backend>::QuantizedTensorPrimitive,
min: <B as Backend>::FloatElem,
max: <B as Backend>::FloatElem,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_clamp( tensor: <B as Backend>::QuantizedTensorPrimitive, min: <B as Backend>::FloatElem, max: <B as Backend>::FloatElem, ) -> <B as Backend>::QuantizedTensorPrimitive
Clamps a tensor between a minimum and maximum value. Read more
§fn q_sub(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_sub( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Subtracts two tensors. Read more
§fn q_sub_scalar(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::FloatElem,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_sub_scalar( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> <B as Backend>::QuantizedTensorPrimitive
Subtracts a scalar from a tensor. Read more
§fn q_mul(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_mul( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Multiplies two tensors together element-wise.
§fn q_mul_scalar(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::FloatElem,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_mul_scalar( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> <B as Backend>::QuantizedTensorPrimitive
Multiplies a tensor by a scalar. Read more
§fn q_div(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_div( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Divides two tensors element-wise. Read more
§fn q_div_scalar(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::FloatElem,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_div_scalar( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> <B as Backend>::QuantizedTensorPrimitive
Divides a tensor by a scalar. Read more
§fn q_remainder_scalar(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::FloatElem,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_remainder_scalar( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> <B as Backend>::QuantizedTensorPrimitive
Computes the modulus of a tensor given a scalar. Read more
§fn q_matmul(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_matmul( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Multiplies two tensors together using matrix multiplication. Read more
§fn q_neg(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_neg( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Negates a tensor element-wise.
§fn q_recip(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_recip( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Calculates the reciprocals element-wise
§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
§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
§fn q_scatter(
dim: usize,
tensor: <B as Backend>::QuantizedTensorPrimitive,
indices: <B as Backend>::IntTensorPrimitive,
value: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_scatter( dim: usize, tensor: <B as Backend>::QuantizedTensorPrimitive, indices: <B as Backend>::IntTensorPrimitive, value: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Scatter elements into a tensor. Read more
§fn q_select_assign(
tensor: <B as Backend>::QuantizedTensorPrimitive,
dim: usize,
indices: <B as Backend>::IntTensorPrimitive,
value: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_select_assign( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, indices: <B as Backend>::IntTensorPrimitive, value: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Assign the selected elements along the given dimension corresponding for the given indices
to the given value. Read more
§fn q_slice_assign(
tensor: <B as Backend>::QuantizedTensorPrimitive,
ranges: &[Range<usize>],
value: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_slice_assign( tensor: <B as Backend>::QuantizedTensorPrimitive, ranges: &[Range<usize>], value: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Assign the selected elements corresponding for the given ranges to the given value. Read more
§fn q_mask_where(
tensor: <B as Backend>::QuantizedTensorPrimitive,
mask: <B as Backend>::BoolTensorPrimitive,
value: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_mask_where( tensor: <B as Backend>::QuantizedTensorPrimitive, mask: <B as Backend>::BoolTensorPrimitive, value: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Update the given tensor with the value tensor where the mask is true. Read more
§fn q_mask_fill(
tensor: <B as Backend>::QuantizedTensorPrimitive,
mask: <B as Backend>::BoolTensorPrimitive,
value: <B as Backend>::FloatElem,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_mask_fill( tensor: <B as Backend>::QuantizedTensorPrimitive, mask: <B as Backend>::BoolTensorPrimitive, value: <B as Backend>::FloatElem, ) -> <B as Backend>::QuantizedTensorPrimitive
Update the given tensor with the value where the mask is true. Read more
§fn q_sum(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_sum( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Sum of all elements in a tensor. Read more
§fn q_sum_dim(
tensor: <B as Backend>::QuantizedTensorPrimitive,
dim: usize,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_sum_dim( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <B as Backend>::QuantizedTensorPrimitive
Sum of all elements in a tensor along a dimension. Read more
§fn q_prod(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_prod( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Product of all elements in a tensor. Read more
§fn q_prod_dim(
tensor: <B as Backend>::QuantizedTensorPrimitive,
dim: usize,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_prod_dim( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <B as Backend>::QuantizedTensorPrimitive
Product of all elements in a tensor along a dimension. Read more
§fn q_mean(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_mean( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Mean of all elements in a tensor. Read more
§fn q_mean_dim(
tensor: <B as Backend>::QuantizedTensorPrimitive,
dim: usize,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_mean_dim( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <B as Backend>::QuantizedTensorPrimitive
Mean of all elements in a tensor along a dimension. Read more
§fn q_exp(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_exp( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Returns a new tensor with exponential values. Read more
§fn q_log(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_log( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Returns a new tensor with natural logarithm values. Read more
§fn q_log1p(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_log1p( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Returns a new tensor with logarithm values of (1 + Xi). Read more
§fn q_powf(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_powf( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Element-wise power with another tensor. Read more
§fn q_powi(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_powi( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Element-wise power with an IntTensor. Read more
§fn q_powi_scalar(
lhs: <B as Backend>::QuantizedTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_powi_scalar( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::QuantizedTensorPrimitive
Element-wise power with an int scalar. Read more
§fn q_powf_scalar(
tensor: <B as Backend>::QuantizedTensorPrimitive,
value: f32,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_powf_scalar( tensor: <B as Backend>::QuantizedTensorPrimitive, value: f32, ) -> <B as Backend>::QuantizedTensorPrimitive
Element-wise power with a float scalar. Read more
§fn q_sqrt(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_sqrt( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Returns a new tensor with square root values. Read more
§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
§fn q_cos(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_cos( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Returns a new tensor with cosine values. Read more
§fn q_sin(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_sin( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Returns a new tensor with sine values. Read more
§fn q_tanh(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_tanh( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Returns a new tensor with tangent values. Read more
§fn q_erf(
tensor: <B as Backend>::QuantizedTensorPrimitive,
) -> <B as Backend>::QuantizedTensorPrimitive
fn q_erf( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive
Returns a new tensor with the error function values. Read more
§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
§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
§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
§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 more§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
§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 more§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
impl<E, Q> Copy for LibTorch<E, Q>
Auto Trait Implementations§
impl<E, Q> Freeze for LibTorch<E, Q>
impl<E, Q> RefUnwindSafe for LibTorch<E, Q>where
E: RefUnwindSafe,
Q: RefUnwindSafe,
impl<E, Q> Send for LibTorch<E, Q>
impl<E, Q> Sync for LibTorch<E, Q>
impl<E, Q> Unpin for LibTorch<E, Q>
impl<E, Q> UnwindSafe for LibTorch<E, Q>where
E: UnwindSafe,
Q: 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.