Struct burn::backend::ndarray::NdArray

pub struct NdArray<E = f32, I = i64, Q = i8> { /* private fields */ }
Expand description

Tensor backend that uses the ndarray crate for executing tensor operations.

This backend is compatible with CPUs and can be compiled for almost any platform, including wasm, arm, and x86.

Trait Implementations§

§

impl<E, I, Q> ActivationOps<NdArray<E, I, Q>> for NdArray<E, I, Q>
where E: FloatNdArrayElement, I: IntNdArrayElement, Q: QuantElement,

§

fn relu(tensor: NdArrayTensor<E>) -> NdArrayTensor<E>

Applies the ReLU activation function. Read more
§

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

Applies the ReLU activation function backward. Read more
§

fn gelu( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Applies the Gelu activation function. Read more
§

fn prelu( tensor: <B as Backend>::FloatTensorPrimitive, alpha: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Applies the PReLu activation function. Read more
§

fn gelu_backward( x: <B as Backend>::FloatTensorPrimitive, grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Applies the Gelu activation function backward. Read more
§

fn sigmoid( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Applies the Sigmoid activation function. Read more
§

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

Applies the hard Sigmoid activation function. Read more
§

fn log_sigmoid( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Applies the LogSigmoid activation function. Read more
§

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, I, Q> Backend for NdArray<E, I, Q>
where E: FloatNdArrayElement, I: IntNdArrayElement, Q: QuantElement,

§

type Device = NdArrayDevice

Device type.
§

type FullPrecisionBridge = PrecisionBridge<f32>

A bridge that can cast tensors to full precision.
§

type FloatTensorPrimitive = NdArrayTensor<E>

Tensor primitive to be used for all float operations.
§

type FloatElem = E

Float element type.
§

type IntTensorPrimitive = NdArrayTensor<I>

Tensor primitive to be used for all int operations.
§

type IntElem = I

Int element type.
§

type BoolTensorPrimitive = NdArrayTensor<bool>

Tensor primitive to be used for all bool operations.
§

type QuantizedTensorPrimitive = NdArrayQTensor<Q>

Tensor primitive to be used for all quantized operations.
§

type QuantizedEncoding = Q

Quantized tensor encoding type.
§

fn ad_enabled() -> bool

If autodiff is enabled.
§

fn name() -> String

Name of the backend.
§

fn seed(seed: u64)

Seed the backend.
§

fn sync(_device: &Self::Device)

Sync the backend, ensure that all computation are finished.
§

impl<TElem, OElem, QElem, IntElem> BackendBridge<NdArray<OElem, IntElem, QElem>> for PrecisionBridge<TElem>
where TElem: FloatNdArrayElement, OElem: FloatNdArrayElement, QElem: QuantElement, IntElem: IntNdArrayElement,

§

type Target = NdArray<TElem, IntElem, QElem>

The target backend
§

fn into_target( tensor: <NdArray<OElem> as Backend>::FloatTensorPrimitive, _device: Option<NdArrayDevice>, ) -> <<PrecisionBridge<TElem> as BackendBridge<NdArray<OElem, IntElem, QElem>>>::Target as Backend>::FloatTensorPrimitive

Transfer the tensor to the target backend.
§

fn from_target( tensor: <<PrecisionBridge<TElem> as BackendBridge<NdArray<OElem, IntElem, QElem>>>::Target as Backend>::FloatTensorPrimitive, _device: Option<NdArrayDevice>, ) -> <NdArray<OElem> as Backend>::FloatTensorPrimitive

Transfer the tensor from the target backend.
§

impl<E, I, Q> BoolTensorOps<NdArray<E, I, Q>> for NdArray<E, I, Q>
where E: FloatNdArrayElement, I: IntNdArrayElement, Q: QuantElement,

§

fn bool_from_data( data: TensorData, _device: &NdArrayDevice, ) -> NdArrayTensor<bool>

Creates a tensor from the data structure. Read more
§

fn bool_shape(tensor: &NdArrayTensor<bool>) -> Shape

Returns the shape of the tensor. Read more
§

async fn bool_into_data(tensor: NdArrayTensor<bool>) -> TensorData

Converts the tensor to a data structure. Read more
§

fn bool_to_device( tensor: NdArrayTensor<bool>, _device: &NdArrayDevice, ) -> NdArrayTensor<bool>

Moves the tensor to the device.
§

fn bool_reshape( tensor: NdArrayTensor<bool>, shape: Shape, ) -> NdArrayTensor<bool>

Reshapes the tensor. Read more
§

fn bool_slice( tensor: NdArrayTensor<bool>, ranges: &[Range<usize>], ) -> NdArrayTensor<bool>

Gets the values from the tensor for the given ranges. Read more
§

fn bool_into_int(tensor: NdArrayTensor<bool>) -> NdArrayTensor<I>

Converts bool tensor to int tensor. Read more
§

fn bool_device(_tensor: &NdArrayTensor<bool>) -> <NdArray<E> as Backend>::Device

Gets the device of the tensor. Read more
§

fn bool_empty( shape: Shape, _device: &<NdArray<E> as Backend>::Device, ) -> NdArrayTensor<bool>

Creates a new bool tensor. Read more
§

fn bool_slice_assign( tensor: NdArrayTensor<bool>, ranges: &[Range<usize>], value: NdArrayTensor<bool>, ) -> NdArrayTensor<bool>

Sets the values in the tensor for the given ranges. Read more
§

fn bool_cat( tensors: Vec<NdArrayTensor<bool>>, dim: usize, ) -> NdArrayTensor<bool>

Concatenates the tensors along the given dimension. Read more
§

fn bool_equal( lhs: NdArrayTensor<bool>, rhs: NdArrayTensor<bool>, ) -> NdArrayTensor<bool>

Equates the two tensors. Read more
§

fn bool_not(tensor: NdArrayTensor<bool>) -> NdArrayTensor<bool>

Inverses boolean values. Read more
§

fn bool_into_float( tensor: NdArrayTensor<bool>, ) -> <NdArray<E> as Backend>::FloatTensorPrimitive

Converts bool tensor to float tensor. Read more
§

fn bool_swap_dims( tensor: NdArrayTensor<bool>, dim1: usize, dim2: usize, ) -> NdArrayTensor<bool>

Swaps two dimensions of a bool tensor. Read more
§

fn bool_permute( tensor: NdArrayTensor<bool>, axes: &[usize], ) -> NdArrayTensor<bool>

Permutes the dimensions of a tensor. Read more
§

fn bool_expand(tensor: NdArrayTensor<bool>, shape: Shape) -> NdArrayTensor<bool>

Broadcasts the bool tensor to the given shape.
§

fn bool_flip(tensor: NdArrayTensor<bool>, axes: &[usize]) -> NdArrayTensor<bool>

Reverse the order of elements in a tensor along the given axes. Read more
§

fn bool_repeat_dim( tensor: <B as Backend>::BoolTensorPrimitive, dim: usize, times: usize, ) -> <B as Backend>::BoolTensorPrimitive

Repeats one dimension of the tensor a given number of times along that dimension. Read more
§

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

Transposes a bool tensor. Read more
§

fn bool_narrow( tensor: <B as Backend>::BoolTensorPrimitive, dim: usize, start: usize, length: usize, ) -> <B as Backend>::BoolTensorPrimitive

Returns a new tensor with the given dimension narrowed to the given range. Read more
§

fn bool_chunk( tensor: <B as Backend>::BoolTensorPrimitive, chunks: usize, dim: usize, ) -> Vec<<B as Backend>::BoolTensorPrimitive>

Split the tensor along the given dimension into chunks. Read more
§

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

Tests if any element in the boolean tensor evaluates to True along a given dimension dim. Read more
§

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

Tests if all elements in the boolean tensor evaluate to True along a given dimension dim. Read more
§

fn bool_argwhere( tensor: <B as Backend>::BoolTensorPrimitive, ) -> impl Future<Output = <B as Backend>::IntTensorPrimitive> + Send

Compute the indices of the elements that are non-zero, grouped by element. Read more
§

fn bool_nonzero( tensor: <B as Backend>::BoolTensorPrimitive, ) -> impl Future<Output = Vec<<B as Backend>::IntTensorPrimitive>> + Send

Compute the indices of the elements that are non-zero. Read more
§

impl<E, I, Q> Clone for NdArray<E, I, Q>
where E: Clone, I: Clone, Q: Clone,

§

fn clone(&self) -> NdArray<E, I, Q>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<E, I, Q> Debug for NdArray<E, I, Q>
where E: Debug, I: Debug, Q: Debug,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<E, I, Q> Default for NdArray<E, I, Q>
where E: Default, I: Default, Q: Default,

§

fn default() -> NdArray<E, I, Q>

Returns the “default value” for a type. Read more
§

impl<E, I, Q> FloatTensorOps<NdArray<E, I, Q>> for NdArray<E, I, Q>
where E: FloatNdArrayElement, I: IntNdArrayElement, Q: QuantElement,

§

fn float_from_data( data: TensorData, _device: &NdArrayDevice, ) -> NdArrayTensor<E>

Creates a new tensor from the data structure. Read more
§

fn float_random( shape: Shape, distribution: Distribution, device: &NdArrayDevice, ) -> NdArrayTensor<E>

Creates a new tensor with random values. Read more
§

fn float_shape(tensor: &NdArrayTensor<E>) -> Shape

Gets the shape of the tensor. Read more
§

async fn float_into_data(tensor: NdArrayTensor<E>) -> TensorData

Converts the tensor to a data structure. Read more
§

fn float_device(_tensor: &NdArrayTensor<E>) -> NdArrayDevice

Gets the device of the tensor. Read more
§

fn float_to_device( tensor: NdArrayTensor<E>, _device: &NdArrayDevice, ) -> NdArrayTensor<E>

Moves the tensor to the given device. Read more
§

fn float_empty( shape: Shape, device: &<NdArray<E> as Backend>::Device, ) -> NdArrayTensor<E>

Creates an empty tensor with the given shape. Read more
§

fn float_add(lhs: NdArrayTensor<E>, rhs: NdArrayTensor<E>) -> NdArrayTensor<E>

Adds two tensors together. Read more
§

fn float_add_scalar(lhs: NdArrayTensor<E>, rhs: E) -> NdArrayTensor<E>

Adds a scalar to a tensor. Read more
§

fn float_sub(lhs: NdArrayTensor<E>, rhs: NdArrayTensor<E>) -> NdArrayTensor<E>

Subtracts two tensors. Read more
§

fn float_sub_scalar(lhs: NdArrayTensor<E>, rhs: E) -> NdArrayTensor<E>

Subtracts a scalar from a tensor. Read more
§

fn float_mul(lhs: NdArrayTensor<E>, rhs: NdArrayTensor<E>) -> NdArrayTensor<E>

Multiplies two tensors together element-wise.
§

fn float_mul_scalar(lhs: NdArrayTensor<E>, rhs: E) -> NdArrayTensor<E>

Multiplies a tensor by a scalar. Read more
§

fn float_div(lhs: NdArrayTensor<E>, rhs: NdArrayTensor<E>) -> NdArrayTensor<E>

Divides two tensors element-wise. Read more
§

fn float_div_scalar(lhs: NdArrayTensor<E>, rhs: E) -> NdArrayTensor<E>

Divides a tensor by a scalar. Read more
§

fn float_remainder_scalar(lhs: NdArrayTensor<E>, rhs: E) -> NdArrayTensor<E>

Computes the modulus of a tensor given a scalar. Read more
§

fn float_matmul( lhs: NdArrayTensor<E>, rhs: NdArrayTensor<E>, ) -> NdArrayTensor<E>

Multiplies two tensors together using matrix multiplication. Read more
§

fn float_neg(tensor: NdArrayTensor<E>) -> NdArrayTensor<E>

Negates a tensor element-wise.
§

fn float_recip(tensor: NdArrayTensor<E>) -> NdArrayTensor<E>

Calculates the reciprocals element-wise
§

fn float_swap_dims( tensor: NdArrayTensor<E>, dim1: usize, dim2: usize, ) -> NdArrayTensor<E>

Swaps two dimensions of a tensor. Read more
§

fn float_reshape(tensor: NdArrayTensor<E>, shape: Shape) -> NdArrayTensor<E>

Reshapes a tensor. Read more
§

fn float_gather( dim: usize, tensor: NdArrayTensor<E>, indices: NdArrayTensor<I>, ) -> NdArrayTensor<E>

Gather elements from a tensor. Read more
§

fn float_scatter( dim: usize, tensor: NdArrayTensor<E>, indices: NdArrayTensor<I>, value: NdArrayTensor<E>, ) -> NdArrayTensor<E>

Scatter elements into a tensor. Read more
§

fn float_select( tensor: NdArrayTensor<E>, dim: usize, indices: NdArrayTensor<I>, ) -> NdArrayTensor<E>

Select tensor elements along the given dimension corresponding for the given indices. Read more
§

fn float_select_assign( tensor: NdArrayTensor<E>, dim: usize, indices: NdArrayTensor<I>, value: NdArrayTensor<E>, ) -> NdArrayTensor<E>

Assign the selected elements along the given dimension corresponding for the given indices to the given value. Read more
§

fn float_slice( tensor: NdArrayTensor<E>, ranges: &[Range<usize>], ) -> NdArrayTensor<E>

Select tensor elements corresponding for the given ranges. Read more
§

fn float_slice_assign( tensor: NdArrayTensor<E>, ranges: &[Range<usize>], value: NdArrayTensor<E>, ) -> NdArrayTensor<E>

Assign the selected elements corresponding for the given ranges to the given value. Read more
§

fn float_mask_where( tensor: NdArrayTensor<E>, mask: NdArrayTensor<bool>, value: NdArrayTensor<E>, ) -> NdArrayTensor<E>

Update the given tensor with the value tensor where the mask is true. Read more
§

fn float_mask_fill( tensor: NdArrayTensor<E>, mask: NdArrayTensor<bool>, value: E, ) -> NdArrayTensor<E>

Update the given tensor with the value where the mask is true. Read more
§

fn float_equal( lhs: NdArrayTensor<E>, rhs: NdArrayTensor<E>, ) -> NdArrayTensor<bool>

Equal comparison of two tensors. Read more
§

fn float_equal_elem(lhs: NdArrayTensor<E>, rhs: E) -> NdArrayTensor<bool>

Equal comparison of a tensor and a scalar. Read more
§

fn float_greater( lhs: NdArrayTensor<E>, rhs: NdArrayTensor<E>, ) -> NdArrayTensor<bool>

Greater than comparison of two tensors. Read more
§

fn float_greater_elem(lhs: NdArrayTensor<E>, rhs: E) -> NdArrayTensor<bool>

Greater than comparison of a tensor and a scalar. Read more
§

fn float_greater_equal( lhs: NdArrayTensor<E>, rhs: NdArrayTensor<E>, ) -> NdArrayTensor<bool>

Greater than or equal comparison of two tensors. Read more
§

fn float_greater_equal_elem( lhs: NdArrayTensor<E>, rhs: E, ) -> NdArrayTensor<bool>

Greater than or equal comparison of a tensor and a scalar. Read more
§

fn float_lower( lhs: NdArrayTensor<E>, rhs: NdArrayTensor<E>, ) -> NdArrayTensor<bool>

Less than comparison of two tensors. Read more
§

fn float_lower_elem(lhs: NdArrayTensor<E>, rhs: E) -> NdArrayTensor<bool>

Less than comparison of a tensor and a scalar. Read more
§

fn float_lower_equal( lhs: NdArrayTensor<E>, rhs: NdArrayTensor<E>, ) -> NdArrayTensor<bool>

Less than or equal comparison of two tensors. Read more
§

fn float_lower_equal_elem(lhs: NdArrayTensor<E>, rhs: E) -> NdArrayTensor<bool>

Less than or equal comparison of a tensor and a scalar. Read more
§

fn float_detach(tensor: NdArrayTensor<E>) -> NdArrayTensor<E>

Detaches a tensor from the computation graph.
§

fn float_mean(tensor: NdArrayTensor<E>) -> NdArrayTensor<E>

Mean of all elements in a tensor. Read more
§

fn float_sum(tensor: NdArrayTensor<E>) -> NdArrayTensor<E>

Sum of all elements in a tensor. Read more
§

fn float_mean_dim(tensor: NdArrayTensor<E>, dim: usize) -> NdArrayTensor<E>

Mean of all elements in a tensor along a dimension. Read more
§

fn float_sum_dim(tensor: NdArrayTensor<E>, dim: usize) -> NdArrayTensor<E>

Sum of all elements in a tensor along a dimension. Read more
§

fn float_argmax(tensor: NdArrayTensor<E>, dim: usize) -> NdArrayTensor<I>

Gets the indices of the maximum elements of a tensor along an axis. Read more
§

fn float_argmin(tensor: NdArrayTensor<E>, dim: usize) -> NdArrayTensor<I>

Gets the indices of the minimum elements of a tensor along an axis. Read more
§

fn float_exp(tensor: NdArrayTensor<E>) -> NdArrayTensor<E>

Returns a new tensor with exponential values. Read more
§

fn float_log(tensor: NdArrayTensor<E>) -> NdArrayTensor<E>

Returns a new tensor with natural logarithm values. Read more
§

fn float_log1p(tensor: NdArrayTensor<E>) -> NdArrayTensor<E>

Returns a new tensor with logarithm values of (1 + Xi). Read more
§

fn float_powf_scalar(tensor: NdArrayTensor<E>, value: f32) -> NdArrayTensor<E>

Returns a new tensor with values raised to the power of float value. Read more
§

fn float_sqrt(tensor: NdArrayTensor<E>) -> NdArrayTensor<E>

Returns a new tensor with square root values. Read more
§

fn float_abs(tensor: NdArrayTensor<E>) -> NdArrayTensor<E>

Returns a new tensor with absolute values. Read more
§

fn float_cos(tensor: NdArrayTensor<E>) -> NdArrayTensor<E>

Returns a new tensor with cosine values. Read more
§

fn float_sin(tensor: NdArrayTensor<E>) -> NdArrayTensor<E>

Returns a new tensor with sine values. Read more
§

fn float_tanh(tensor: NdArrayTensor<E>) -> NdArrayTensor<E>

Returns a new tensor with tangent values. Read more
§

fn float_round(tensor: NdArrayTensor<E>) -> NdArrayTensor<E>

Returns a new tensor with rounded values. Read more
§

fn float_floor(tensor: NdArrayTensor<E>) -> NdArrayTensor<E>

Returns a new tensor with floored values. Read more
§

fn float_ceil(tensor: NdArrayTensor<E>) -> NdArrayTensor<E>

Returns a new tensor with ceiled values. Read more
§

fn float_erf(tensor: NdArrayTensor<E>) -> NdArrayTensor<E>

Returns a new tensor with the error function values. Read more
§

fn float_cat(tensors: Vec<NdArrayTensor<E>>, dim: usize) -> NdArrayTensor<E>

Concatenates tensors along a dimension. Read more
§

fn float_clamp_min(tensor: NdArrayTensor<E>, min: E) -> NdArrayTensor<E>

Clamps a tensor under a minimum value. Read more
§

fn float_clamp_max(tensor: NdArrayTensor<E>, max: E) -> NdArrayTensor<E>

Clamps a tensor over a maximum value. Read more
§

fn float_clamp(tensor: NdArrayTensor<E>, min: E, max: E) -> NdArrayTensor<E>

Clamps a tensor between a minimum and maximum value. Read more
§

fn float_into_int(tensor: NdArrayTensor<E>) -> NdArrayTensor<I>

Converts float tensor to int tensor. Read more
§

fn float_powf(lhs: NdArrayTensor<E>, rhs: NdArrayTensor<E>) -> NdArrayTensor<E>

Element-wise power with a FloatTensor. Read more
§

fn float_permute(tensor: NdArrayTensor<E>, axes: &[usize]) -> NdArrayTensor<E>

Permutes the dimensions of a tensor. Read more
§

fn float_flip(tensor: NdArrayTensor<E>, axes: &[usize]) -> NdArrayTensor<E>

Reverse the order of elements in a tensor along the given axes. Read more
§

fn float_sign(tensor: NdArrayTensor<E>) -> NdArrayTensor<E>

Returns the signs of the float tensor. Read more
§

fn float_expand(tensor: NdArrayTensor<E>, shape: Shape) -> NdArrayTensor<E>

Broadcasts the float tensor to the given shape.
§

fn float_zeros( shape: Shape, device: &<B as Backend>::Device, ) -> <B as Backend>::FloatTensorPrimitive

Creates a new tensor with zeros. Read more
§

fn float_ones( shape: Shape, device: &<B as Backend>::Device, ) -> <B as Backend>::FloatTensorPrimitive

Creates a new tensor with ones. Read more
§

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_repeat_dim( tensor: <B as Backend>::FloatTensorPrimitive, dim: usize, times: usize, ) -> <B as Backend>::FloatTensorPrimitive

Repeat the tensor along the given dimension. Read more
§

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

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

Element-wise non-equality comparison with a scalar. Read more
§

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

Returns the require_grad flag of a tensor.
§

fn float_prod( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Product of all elements in a tensor. Read more
§

fn float_prod_dim( tensor: <B as Backend>::FloatTensorPrimitive, dim: usize, ) -> <B as Backend>::FloatTensorPrimitive

Product of all elements in a tensor along a dimension. Read more
§

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

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

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

raises a tensor to the power of an int scalar. Read more
§

fn float_max( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Gets the maximum element of a tensor. Read more
§

fn float_max_dim( tensor: <B as Backend>::FloatTensorPrimitive, dim: usize, ) -> <B as Backend>::FloatTensorPrimitive

Gets the maximum elements of a tensor along an axis. Read more
§

fn float_max_dim_with_indices( tensor: <B as Backend>::FloatTensorPrimitive, dim: usize, ) -> (<B as Backend>::FloatTensorPrimitive, <B as Backend>::IntTensorPrimitive)

Gets the maximum elements of a tensor along an axis and their indices. Read more
§

fn float_min( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Gets the minimum element of a tensor. Read more
§

fn float_min_dim( tensor: <B as Backend>::FloatTensorPrimitive, dim: usize, ) -> <B as Backend>::FloatTensorPrimitive

Gets the minimum elements of a tensor along an axis. Read more
§

fn float_min_dim_with_indices( tensor: <B as Backend>::FloatTensorPrimitive, dim: usize, ) -> (<B as Backend>::FloatTensorPrimitive, <B as Backend>::IntTensorPrimitive)

Gets the minimum elements of a tensor along an axis and their indices. Read more
§

fn float_narrow( tensor: <B as Backend>::FloatTensorPrimitive, dim: usize, start: usize, length: usize, ) -> <B as Backend>::FloatTensorPrimitive

Returns a new tensor with the given dimension narrowed to the given range. Read more
§

fn float_chunk( tensor: <B as Backend>::FloatTensorPrimitive, chunks: usize, dim: usize, ) -> Vec<<B as Backend>::FloatTensorPrimitive>

Split the tensor along the given dimension into chunks. Read more
§

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

Tests if any element in the float tensor evaluates to True along a given dimension dim. Read more
§

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

Tests if all elements in the float tensor evaluate to True along a given dimension dim. Read more
§

fn float_sort( tensor: <B as Backend>::FloatTensorPrimitive, dim: usize, descending: bool, ) -> <B as Backend>::FloatTensorPrimitive

Sort the elements of the input tensor by value in along a given dimension. Read more
§

fn float_sort_with_indices( tensor: <B as Backend>::FloatTensorPrimitive, dim: usize, descending: bool, ) -> (<B as Backend>::FloatTensorPrimitive, <B as Backend>::IntTensorPrimitive)

Sort the elements of the input tensor by value in along a given dimension. Read more
§

fn float_argsort( tensor: <B as Backend>::FloatTensorPrimitive, dim: usize, descending: bool, ) -> <B as Backend>::IntTensorPrimitive

Returns the indices that sort the elements of the input tensor by value along a given dimension. Read more
§

impl<E, I, Q> IntTensorOps<NdArray<E, I, Q>> for NdArray<E, I, Q>
where E: FloatNdArrayElement, I: IntNdArrayElement, Q: QuantElement,

§

fn int_from_data(data: TensorData, _device: &NdArrayDevice) -> NdArrayTensor<I>

Creates a tensor from the data structure. Read more
§

fn int_shape(tensor: &NdArrayTensor<I>) -> Shape

Returns the shape of the tensor. Read more
§

async fn int_into_data(tensor: NdArrayTensor<I>) -> TensorData

Converts the tensor to a data structure. Read more
§

fn int_to_device( tensor: NdArrayTensor<I>, _device: &NdArrayDevice, ) -> NdArrayTensor<I>

Moves the tensor to the given device.
§

fn int_reshape(tensor: NdArrayTensor<I>, shape: Shape) -> NdArrayTensor<I>

Reshapes the tensor. Read more
§

fn int_slice( tensor: NdArrayTensor<I>, ranges: &[Range<usize>], ) -> NdArrayTensor<I>

Gets the element at the given indices. Read more
§

fn int_device(_tensor: &NdArrayTensor<I>) -> <NdArray<E> as Backend>::Device

Gets the device of the tensor. Read more
§

fn int_empty( shape: Shape, _device: &<NdArray<E> as Backend>::Device, ) -> NdArrayTensor<I>

Creates a new int tensor. Read more
§

fn int_mask_where( tensor: NdArrayTensor<I>, mask: NdArrayTensor<bool>, source: NdArrayTensor<I>, ) -> NdArrayTensor<I>

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: NdArrayTensor<I>, mask: NdArrayTensor<bool>, value: I, ) -> NdArrayTensor<I>

Fills the tensor with the given value if the mask is true at the given indices. Read more
§

fn int_slice_assign( tensor: NdArrayTensor<I>, ranges: &[Range<usize>], value: NdArrayTensor<I>, ) -> NdArrayTensor<I>

Sets the element at the given indices. Read more
§

fn int_cat(tensors: Vec<NdArrayTensor<I>>, dim: usize) -> NdArrayTensor<I>

Concatenates the given tensors along the given dimension. Read more
§

fn int_equal( lhs: NdArrayTensor<I>, rhs: NdArrayTensor<I>, ) -> NdArrayTensor<bool>

Element-wise equality comparison. Read more
§

fn int_equal_elem(lhs: NdArrayTensor<I>, rhs: I) -> NdArrayTensor<bool>

Element-wise equality comparison with a scalar. Read more
§

fn int_greater( lhs: NdArrayTensor<I>, rhs: NdArrayTensor<I>, ) -> NdArrayTensor<bool>

Element-wise greater than comparison. Read more
§

fn int_greater_elem(lhs: NdArrayTensor<I>, rhs: I) -> NdArrayTensor<bool>

Element-wise greater than comparison with a scalar. Read more
§

fn int_greater_equal( lhs: NdArrayTensor<I>, rhs: NdArrayTensor<I>, ) -> NdArrayTensor<bool>

Element-wise greater than or equal comparison. Read more
§

fn int_greater_equal_elem(lhs: NdArrayTensor<I>, rhs: I) -> NdArrayTensor<bool>

Element-wise greater than or equal comparison with a scalar. Read more
§

fn int_lower( lhs: NdArrayTensor<I>, rhs: NdArrayTensor<I>, ) -> NdArrayTensor<bool>

Element-wise less than comparison. Read more
§

fn int_lower_elem(lhs: NdArrayTensor<I>, rhs: I) -> NdArrayTensor<bool>

Element-wise less than comparison with a scalar. Read more
§

fn int_lower_equal( lhs: NdArrayTensor<I>, rhs: NdArrayTensor<I>, ) -> NdArrayTensor<bool>

Element-wise less than or equal comparison. Read more
§

fn int_lower_equal_elem(lhs: NdArrayTensor<I>, rhs: I) -> NdArrayTensor<bool>

Element-wise less than or equal comparison with a scalar. Read more
§

fn int_add(lhs: NdArrayTensor<I>, rhs: NdArrayTensor<I>) -> NdArrayTensor<I>

Element-wise addition. Read more
§

fn int_add_scalar(lhs: NdArrayTensor<I>, rhs: I) -> NdArrayTensor<I>

Element-wise addition with a scalar. Read more
§

fn int_sub(lhs: NdArrayTensor<I>, rhs: NdArrayTensor<I>) -> NdArrayTensor<I>

Element-wise subtraction. Read more
§

fn int_sub_scalar(lhs: NdArrayTensor<I>, rhs: I) -> NdArrayTensor<I>

Element-wise subtraction with a scalar. Read more
§

fn int_mul(lhs: NdArrayTensor<I>, rhs: NdArrayTensor<I>) -> NdArrayTensor<I>

Element-wise multiplication. Read more
§

fn int_mul_scalar(lhs: NdArrayTensor<I>, rhs: I) -> NdArrayTensor<I>

Element-wise multiplication with a scalar. Read more
§

fn int_div(lhs: NdArrayTensor<I>, rhs: NdArrayTensor<I>) -> NdArrayTensor<I>

Element-wise division. Read more
§

fn int_div_scalar(lhs: NdArrayTensor<I>, rhs: I) -> NdArrayTensor<I>

Element-wise division with a scalar. Read more
§

fn int_remainder_scalar(lhs: NdArrayTensor<I>, rhs: I) -> NdArrayTensor<I>

Element-wise modulus with a scalar. Read more
§

fn int_neg(tensor: NdArrayTensor<I>) -> NdArrayTensor<I>

Element-wise negation. Read more
§

fn int_zeros( shape: Shape, device: &<NdArray<E> as Backend>::Device, ) -> NdArrayTensor<I>

Creates a tensor of zeros. Read more
§

fn int_ones( shape: Shape, device: &<NdArray<E> as Backend>::Device, ) -> NdArrayTensor<I>

Creates a tensor of ones. Read more
§

fn int_full( shape: Shape, fill_value: I, device: &<NdArray<E> as Backend>::Device, ) -> NdArrayTensor<I>

Creates a tensor filled with given value. Read more
§

fn int_sum(tensor: NdArrayTensor<I>) -> NdArrayTensor<I>

Sums all elements in the tensor. Read more
§

fn int_sum_dim(tensor: NdArrayTensor<I>, dim: usize) -> NdArrayTensor<I>

Sums all elements in the tensor along a dimension. Read more
§

fn int_prod(tensor: NdArrayTensor<I>) -> NdArrayTensor<I>

Computes the product of all elements in the tensor. Read more
§

fn int_prod_dim(tensor: NdArrayTensor<I>, dim: usize) -> NdArrayTensor<I>

Computes the product of all elements in the tensor along a dimension. Read more
§

fn int_mean(tensor: NdArrayTensor<I>) -> NdArrayTensor<I>

Computes the mean of all elements in the tensor. Read more
§

fn int_mean_dim(tensor: NdArrayTensor<I>, dim: usize) -> NdArrayTensor<I>

Computes the mean of all elements in the tensor along a dimension. Read more
§

fn int_gather( dim: usize, tensor: NdArrayTensor<I>, indices: NdArrayTensor<I>, ) -> NdArrayTensor<I>

Gather elements from the tensor at the given indices. Read more
§

fn int_scatter( dim: usize, tensor: NdArrayTensor<I>, indices: NdArrayTensor<I>, value: NdArrayTensor<I>, ) -> NdArrayTensor<I>

Scatter a given value to the tensor at the given indices. Read more
§

fn int_select( tensor: NdArrayTensor<I>, dim: usize, indices: NdArrayTensor<I>, ) -> NdArrayTensor<I>

Select tensor elements along the given dimension corresponding to the given indices. Read more
§

fn int_select_assign( tensor: NdArrayTensor<I>, dim: usize, indices: NdArrayTensor<I>, value: NdArrayTensor<I>, ) -> NdArrayTensor<I>

Assign the selected elements along the given dimension corresponding to the given indices to the given value. Read more
§

fn int_argmax(tensor: NdArrayTensor<I>, dim: usize) -> NdArrayTensor<I>

Gets the indices of the maximum elements along a dimension. Read more
§

fn int_argmin(tensor: NdArrayTensor<I>, dim: usize) -> NdArrayTensor<I>

Gets the indices of the minimum elements along a dimension. Read more
§

fn int_clamp_min(tensor: NdArrayTensor<I>, min: I) -> NdArrayTensor<I>

Clamps a tensor under a minimum value. Read more
§

fn int_clamp_max(tensor: NdArrayTensor<I>, max: I) -> NdArrayTensor<I>

Clamps a tensor over a maximum value. Read more
§

fn int_clamp(tensor: NdArrayTensor<I>, min: I, max: I) -> NdArrayTensor<I>

Clamps a tensor between a minimum and maximum value. Read more
§

fn int_abs(tensor: NdArrayTensor<I>) -> NdArrayTensor<I>

Returns a new tensor with absolute values. Read more
§

fn int_into_float( tensor: NdArrayTensor<I>, ) -> <NdArray<E> as Backend>::FloatTensorPrimitive

Converts int tensor to float tensor. Read more
§

fn int_swap_dims( tensor: NdArrayTensor<I>, dim1: usize, dim2: usize, ) -> NdArrayTensor<I>

Swaps two dimensions of an int tensor. Read more
§

fn int_random( shape: Shape, distribution: Distribution, device: &NdArrayDevice, ) -> NdArrayTensor<I>

Creates a new int tensor with random values. Read more
§

fn int_powi(lhs: NdArrayTensor<I>, rhs: NdArrayTensor<I>) -> NdArrayTensor<I>

Element-wise power with a IntTensor. Read more
§

fn int_powf(lhs: NdArrayTensor<I>, rhs: NdArrayTensor<E>) -> NdArrayTensor<I>

Element-wise power with a floatTensor. Read more
§

fn int_powf_scalar(lhs: NdArrayTensor<I>, rhs: f32) -> NdArrayTensor<I>

Element-wise power with a floatTensor. Read more
§

fn int_permute(tensor: NdArrayTensor<I>, axes: &[usize]) -> NdArrayTensor<I>

Permutes the dimensions of a tensor. Read more
§

fn int_flip(tensor: NdArrayTensor<I>, axes: &[usize]) -> NdArrayTensor<I>

Reverse the order of elements in a tensor along the given axes. Read more
§

fn int_sign(tensor: NdArrayTensor<I>) -> NdArrayTensor<I>

Returns the signs of the int tensor. Read more
§

fn int_expand(tensor: NdArrayTensor<I>, shape: Shape) -> NdArrayTensor<I>

Broadcasts the int tensor to the given shape.
§

fn int_repeat_dim( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, times: usize, ) -> <B as Backend>::IntTensorPrimitive

Repeats the tensor along the given dimension the given number of times. Read more
§

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

Element-wise non-equality comparison with a scalar. Read more
§

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_max( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive

Gets the maximum element in the tensor. Read more
§

fn int_max_dim( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> <B as Backend>::IntTensorPrimitive

Gets the maximum element in the tensor along a dimension. Read more
§

fn int_max_dim_with_indices( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> (<B as Backend>::IntTensorPrimitive, <B as Backend>::IntTensorPrimitive)

Gets the maximum elements and corresponding indices along a dimension. Read more
§

fn int_min( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive

Gets the minimum element in the tensor. Read more
§

fn int_min_dim( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> <B as Backend>::IntTensorPrimitive

Gets the minimum elements in the tensor along a dimension. Read more
§

fn int_min_dim_with_indices( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> (<B as Backend>::IntTensorPrimitive, <B as Backend>::IntTensorPrimitive)

Gets the minimum elements and corresponding indices along a dimension. Read more
§

fn int_transpose( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive

Transposes an int tensor. Read more
§

fn int_narrow( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, start: usize, length: usize, ) -> <B as Backend>::IntTensorPrimitive

Returns a new tensor with the given dimension narrowed to the given range. Read more
§

fn int_chunk( tensor: <B as Backend>::IntTensorPrimitive, chunks: usize, dim: usize, ) -> Vec<<B as Backend>::IntTensorPrimitive>

Split the tensor along the given dimension into chunks. Read more
§

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_arange( range: Range<i64>, device: &<B as Backend>::Device, ) -> <B as Backend>::IntTensorPrimitive

Creates a new tensor with values from the given range. Read more
§

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

Tests if any element in the int tensor evaluates to True along a given dimension dim. Read more
§

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

Tests if all elements in the int tensor evaluate to True along a given dimension dim. Read more
§

fn int_sort( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, descending: bool, ) -> <B as Backend>::IntTensorPrimitive

Sort the elements of the input tensor by value along a given dimension. Read more
§

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
§

fn int_argsort( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, descending: bool, ) -> <B as Backend>::IntTensorPrimitive

Returns the indices that sort the elements of the input tensor by value along a given dimension. Read more
§

impl<E, I, Q> ModuleOps<NdArray<E, I, Q>> for NdArray<E, I, Q>
where E: FloatNdArrayElement, I: IntNdArrayElement, Q: QuantElement,

§

fn conv2d( x: NdArrayTensor<E>, weight: NdArrayTensor<E>, bias: Option<NdArrayTensor<E>>, options: ConvOptions<2>, ) -> NdArrayTensor<E>

Two dimensional convolution. Read more
§

fn deform_conv2d( x: NdArrayTensor<E>, offset: NdArrayTensor<E>, weight: NdArrayTensor<E>, mask: Option<NdArrayTensor<E>>, bias: Option<NdArrayTensor<E>>, options: DeformConvOptions<2>, ) -> NdArrayTensor<E>

Two dimensional deformable convolution. Read more
§

fn deform_conv2d_backward( x: NdArrayTensor<E>, offset: NdArrayTensor<E>, weight: NdArrayTensor<E>, mask: Option<NdArrayTensor<E>>, bias: Option<NdArrayTensor<E>>, output_grad: NdArrayTensor<E>, options: DeformConvOptions<2>, ) -> DeformConv2dBackward<NdArray<E, I, Q>>

Backward pass for the deform_conv2d operation.
§

fn conv_transpose2d( x: NdArrayTensor<E>, weight: NdArrayTensor<E>, bias: Option<NdArrayTensor<E>>, options: ConvTransposeOptions<2>, ) -> NdArrayTensor<E>

Two dimensional transposed convolution. Read more
§

fn avg_pool2d( x: NdArrayTensor<E>, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], count_include_pad: bool, ) -> NdArrayTensor<E>

Two dimensional avg pooling. Read more
§

fn avg_pool2d_backward( x: NdArrayTensor<E>, grad: NdArrayTensor<E>, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], count_include_pad: bool, ) -> NdArrayTensor<E>

Backward pass for the avg pooling 2d operation.
§

fn max_pool2d( x: NdArrayTensor<E>, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], ) -> NdArrayTensor<E>

Two dimensional max pooling. Read more
§

fn max_pool2d_with_indices( x: NdArrayTensor<E>, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], ) -> MaxPool2dWithIndices<NdArray<E, I, Q>>

Two dimensional max pooling with indices. Read more
§

fn max_pool2d_with_indices_backward( x: NdArrayTensor<E>, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], output_grad: NdArrayTensor<E>, indices: NdArrayTensor<I>, ) -> MaxPool2dBackward<NdArray<E, I, Q>>

Backward pass for the max pooling 2d operation.
§

fn adaptive_avg_pool2d( x: NdArrayTensor<E>, output_size: [usize; 2], ) -> NdArrayTensor<E>

Two dimensional adaptive avg pooling. Read more
§

fn adaptive_avg_pool2d_backward( x: NdArrayTensor<E>, grad: NdArrayTensor<E>, ) -> NdArrayTensor<E>

Backward pass for the adaptive avg pooling 2d operation.
§

fn interpolate( x: NdArrayTensor<E>, output_size: [usize; 2], options: InterpolateOptions, ) -> NdArrayTensor<E>

Down/up samples the input. Read more
§

fn interpolate_backward( x: NdArrayTensor<E>, grad: NdArrayTensor<E>, output_size: [usize; 2], options: InterpolateOptions, ) -> NdArrayTensor<E>

Backward pass for the interpolate operation.
§

fn conv3d( x: NdArrayTensor<E>, weight: NdArrayTensor<E>, bias: Option<NdArrayTensor<E>>, options: ConvOptions<3>, ) -> NdArrayTensor<E>

Three dimensional convolution. Read more
§

fn conv_transpose3d( x: NdArrayTensor<E>, weight: NdArrayTensor<E>, bias: Option<NdArrayTensor<E>>, options: ConvTransposeOptions<3>, ) -> NdArrayTensor<E>

Three dimensional transposed convolution. Read more
§

fn embedding( weights: <B as Backend>::FloatTensorPrimitive, indices: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Embedding operation. Read more
§

fn embedding_backward( weights: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, indices: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Embedding backward operation. Read more
§

fn conv1d( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, bias: Option<<B as Backend>::FloatTensorPrimitive>, options: ConvOptions<1>, ) -> <B as Backend>::FloatTensorPrimitive

One dimensional convolution. Read more
§

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

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

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

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

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

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

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

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

Backward pass for the conv3d operation, returning the gradient for bias.
§

fn conv_transpose1d( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, bias: Option<<B as Backend>::FloatTensorPrimitive>, options: ConvTransposeOptions<1>, ) -> <B as Backend>::FloatTensorPrimitive

One dimensional transposed convolution. Read more
§

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

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

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

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

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

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

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

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

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

Four-dimensional unfolding. Read more
§

fn avg_pool1d( x: <B as Backend>::FloatTensorPrimitive, kernel_size: usize, stride: usize, padding: usize, count_include_pad: bool, ) -> <B as Backend>::FloatTensorPrimitive

One dimensional avg pooling. 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

Backward pass for the avg pooling 1d operation.
§

fn adaptive_avg_pool1d( x: <B as Backend>::FloatTensorPrimitive, output_size: usize, ) -> <B as Backend>::FloatTensorPrimitive

One dimensional adaptive avg pooling. Read more
§

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( x: <B as Backend>::FloatTensorPrimitive, kernel_size: usize, stride: usize, padding: usize, dilation: usize, ) -> <B as Backend>::FloatTensorPrimitive

One dimensional max pooling. Read more
§

fn max_pool1d_with_indices( x: <B as Backend>::FloatTensorPrimitive, kernel_size: usize, stride: usize, padding: usize, dilation: usize, ) -> MaxPool1dWithIndices<B>

One dimensional max pooling with indices. Read more
§

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, I, Q> QTensorOps<NdArray<E, I, Q>> for NdArray<E, I, Q>
where E: FloatNdArrayElement, I: IntNdArrayElement, Q: QuantElement,

§

fn q_from_data( data: TensorData, _device: &NdArrayDevice, ) -> <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive

Creates a new tensor from the data structure. Read more
§

fn quantize( tensor: <NdArray<E, I, Q> as Backend>::FloatTensorPrimitive, scheme: &QuantizationScheme, qparams: QuantizationParametersPrimitive<NdArray<E, I, Q>>, ) -> <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive

Convert the tensor to a lower precision data type based on the quantization scheme and parameters.
§

fn dequantize( tensor: <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive, ) -> <NdArray<E, I, Q> as Backend>::FloatTensorPrimitive

Convert the tensor back to a higher precision data type.
§

fn q_shape( tensor: &<NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive, ) -> Shape

Gets the shape of the tensor. Read more
§

fn q_device( _tensor: &<NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive, ) -> NdArrayDevice

Gets the device of the tensor. Read more
§

fn q_to_device( tensor: <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive, _device: &NdArrayDevice, ) -> <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive

Moves the tensor to the given device. Read more
§

fn q_reshape( tensor: <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive, shape: Shape, ) -> <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive

Reshapes a tensor. Read more
§

async fn q_into_data( tensor: <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive, ) -> TensorData

Converts the tensor to a data structure. Read more
§

fn q_swap_dims( tensor: <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive, dim1: usize, dim2: usize, ) -> <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive

Swaps two dimensions of a tensor. Read more
§

fn q_permute( tensor: <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive, axes: &[usize], ) -> <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive

Permutes the dimensions of a tensor. Read more
§

fn q_flip( tensor: <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive, axes: &[usize], ) -> <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive

Reverse the order of elements in a tensor along the given axes. Read more
§

fn q_gather( dim: usize, tensor: <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive, indices: <NdArray<E, I, Q> as Backend>::IntTensorPrimitive, ) -> <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive

Gather elements from a tensor. Read more
§

fn q_select( tensor: <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive, dim: usize, indices: <NdArray<E, I, Q> as Backend>::IntTensorPrimitive, ) -> <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive

Select tensor elements along the given dimension corresponding for the given indices. Read more
§

fn q_slice( tensor: <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive, ranges: &[Range<usize>], ) -> <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive

Select tensor elements corresponding for the given ranges. Read more
§

fn q_argmax( tensor: <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <NdArray<E, I, Q> as Backend>::IntTensorPrimitive

Gets the indices of the maximum elements of a tensor along an axis. Read more
§

fn q_argmin( tensor: <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <NdArray<E, I, Q> as Backend>::IntTensorPrimitive

Gets the indices of the minimum elements of a tensor along an axis. Read more
§

fn q_expand( tensor: <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive, shape: Shape, ) -> <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive

Broadcasts the tensor to the given shape.
§

fn quantize_dynamic( tensor: <B as Backend>::FloatTensorPrimitive, scheme: &QuantizationScheme, ) -> <B as Backend>::QuantizedTensorPrimitive

Dynamically convert the tensor to a lower precision data type based on the quantization scheme.
§

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

Sets the require_grad flag of a tensor.
§

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

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

Adds two tensors together. Read more
§

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

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

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

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

Subtracts two tensors. Read more
§

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

Multiplies two tensors together element-wise.
§

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

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

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

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

Multiplies two tensors together using matrix multiplication. Read more
§

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

Calculates the reciprocals element-wise
§

fn q_transpose( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Transposes 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

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

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

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

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

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

Sum of all elements in a tensor. Read more
§

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

Product of all elements in a tensor. Read more
§

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

Mean of all elements in a tensor. Read more
§

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

Returns a new tensor with exponential values. Read more
§

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

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

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

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

Element-wise power with an int scalar. Read more
§

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

Returns a new tensor with square root values. Read more
§

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

Returns a new tensor with cosine values. Read more
§

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

Returns a new tensor with tangent values. Read more
§

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

Concatenates tensors along a dimension. Read more
§

fn q_max( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Gets the maximum element of a tensor. Read more
§

fn q_max_dim( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <B as Backend>::QuantizedTensorPrimitive

Gets the maximum elements of a tensor along an axis. Read more
§

fn q_max_dim_with_indices( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> (<B as Backend>::QuantizedTensorPrimitive, <B as Backend>::IntTensorPrimitive)

Gets the maximum elements of a tensor along an axis and their indices. Read more
§

fn q_min( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Gets the minimum element of a tensor. Read more
§

fn q_min_dim( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <B as Backend>::QuantizedTensorPrimitive

Gets the minimum elements of a tensor along an axis. Read more
§

fn q_min_dim_with_indices( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> (<B as Backend>::QuantizedTensorPrimitive, <B as Backend>::IntTensorPrimitive)

Gets the minimum elements of a tensor along an axis and their indices. Read more
§

fn q_narrow( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, start: usize, length: usize, ) -> <B as Backend>::QuantizedTensorPrimitive

Returns a new tensor with the given dimension narrowed to the given range. Read more
§

fn q_chunk( tensor: <B as Backend>::QuantizedTensorPrimitive, chunks: usize, dim: usize, ) -> Vec<<B as Backend>::QuantizedTensorPrimitive>

Split the tensor along the given dimension into chunks. Read more
§

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

Tests if any element in the float tensor evaluates to True along a given dimension dim. Read more
§

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

Tests if all elements in the tensor evaluate to True along a given dimension dim. Read more
§

fn q_sort( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, descending: bool, ) -> <B 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: <B as Backend>::QuantizedTensorPrimitive, dim: usize, descending: bool, ) -> (<B as Backend>::QuantizedTensorPrimitive, <B as Backend>::IntTensorPrimitive)

Sort the elements of the input tensor by value in along a given dimension. Read more
§

fn q_argsort( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, descending: bool, ) -> <B as Backend>::IntTensorPrimitive

Returns the indices that sort the elements of the input tensor by value along a given dimension. Read more
§

impl<E, I, Q> ReprBackend for NdArray<E, I, Q>
where E: FloatNdArrayElement, I: IntNdArrayElement, Q: QuantElement,

§

type Handle = HandleKind<NdArray<E, I, Q>>

The type that can be used to point to a tensor of any kind.
§

fn float_tensor( handle: TensorHandle<<NdArray<E, I, Q> as ReprBackend>::Handle>, ) -> <NdArray<E, I, Q> as Backend>::FloatTensorPrimitive

Convert a handle to a float tensor.
§

fn int_tensor( handle: TensorHandle<<NdArray<E, I, Q> as ReprBackend>::Handle>, ) -> <NdArray<E, I, Q> as Backend>::IntTensorPrimitive

Convert a handle to an int tensor.
§

fn bool_tensor( handle: TensorHandle<<NdArray<E, I, Q> as ReprBackend>::Handle>, ) -> <NdArray<E, I, Q> as Backend>::BoolTensorPrimitive

Convert a handle to a bool tensor.
§

fn quantized_tensor( handles: QuantizedKind<TensorHandle<<NdArray<E, I, Q> as ReprBackend>::Handle>>, _scheme: QuantizationScheme, ) -> <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive

Convert a handle to a quantized tensor.
§

fn float_tensor_handle( tensor: <NdArray<E, I, Q> as Backend>::FloatTensorPrimitive, ) -> <NdArray<E, I, Q> as ReprBackend>::Handle

Convert a float tensor to a handle.
§

fn int_tensor_handle( tensor: <NdArray<E, I, Q> as Backend>::IntTensorPrimitive, ) -> <NdArray<E, I, Q> as ReprBackend>::Handle

Convert an int tensor to a handle.
§

fn bool_tensor_handle( tensor: <NdArray<E, I, Q> as Backend>::BoolTensorPrimitive, ) -> <NdArray<E, I, Q> as ReprBackend>::Handle

Convert a bool tensor to a handle.
§

fn quantized_tensor_handle( tensor: <NdArray<E, I, Q> as Backend>::QuantizedTensorPrimitive, ) -> QuantizedKind<<NdArray<E, I, Q> as ReprBackend>::Handle>

Convert a quantized tensor to a handle. A quantized tensor has multiple handles for the tensor itself and the quantization parameters.
§

impl<E, I, Q> Copy for NdArray<E, I, Q>
where E: Copy, I: Copy, Q: Copy,

Auto Trait Implementations§

§

impl<E, I, Q> Freeze for NdArray<E, I, Q>

§

impl<E, I, Q> RefUnwindSafe for NdArray<E, I, Q>

§

impl<E, I, Q> Send for NdArray<E, I, Q>
where E: Send, I: Send, Q: Send,

§

impl<E, I, Q> Sync for NdArray<E, I, Q>
where E: Sync, I: Sync, Q: Sync,

§

impl<E, I, Q> Unpin for NdArray<E, I, Q>
where E: Unpin, I: Unpin, Q: Unpin,

§

impl<E, I, Q> UnwindSafe for NdArray<E, I, Q>
where E: UnwindSafe, I: UnwindSafe, Q: UnwindSafe,

Blanket Implementations§

§

impl<T> Adaptor<()> for T

§

fn adapt(&self)

Adapt the type to be passed to a metric.
source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

source§

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().
source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,