pub struct NdArray<E = f32, 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, Q> ActivationOps<NdArray<E, Q>> for NdArray<E, Q>where
E: FloatNdArrayElement,
Q: QuantElement,
impl<E, Q> ActivationOps<NdArray<E, Q>> for NdArray<E, Q>where
E: FloatNdArrayElement,
Q: QuantElement,
§fn relu<const D: usize>(tensor: NdArrayTensor<E, D>) -> NdArrayTensor<E, D>
fn relu<const D: usize>(tensor: NdArrayTensor<E, D>) -> NdArrayTensor<E, D>
Applies the ReLU activation function. Read more
§fn leaky_relu<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
negative_slope: <B as Backend>::FloatElem,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn leaky_relu<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, negative_slope: <B as Backend>::FloatElem, ) -> <B as Backend>::FloatTensorPrimitive<D>
Applies the LeakyReLU activation function. Read more
§fn relu_backward<const D: usize>(
output: <B as Backend>::FloatTensorPrimitive<D>,
grad: <B as Backend>::FloatTensorPrimitive<D>,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn relu_backward<const D: usize>( output: <B as Backend>::FloatTensorPrimitive<D>, grad: <B as Backend>::FloatTensorPrimitive<D>, ) -> <B as Backend>::FloatTensorPrimitive<D>
Applies the ReLU activation function backward. Read more
§fn gelu<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn gelu<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, ) -> <B as Backend>::FloatTensorPrimitive<D>
Applies the Gelu activation function. Read more
§fn prelu<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
alpha: <B as Backend>::FloatTensorPrimitive<D>,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn prelu<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, alpha: <B as Backend>::FloatTensorPrimitive<D>, ) -> <B as Backend>::FloatTensorPrimitive<D>
Applies the PReLu activation function. Read more
§fn gelu_backward<const D: usize>(
x: <B as Backend>::FloatTensorPrimitive<D>,
grad: <B as Backend>::FloatTensorPrimitive<D>,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn gelu_backward<const D: usize>( x: <B as Backend>::FloatTensorPrimitive<D>, grad: <B as Backend>::FloatTensorPrimitive<D>, ) -> <B as Backend>::FloatTensorPrimitive<D>
Applies the Gelu activation function backward. Read more
§fn sigmoid<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn sigmoid<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, ) -> <B as Backend>::FloatTensorPrimitive<D>
Applies the Sigmoid activation function. Read more
§fn sigmoid_backward<const D: usize>(
output: <B as Backend>::FloatTensorPrimitive<D>,
grad: <B as Backend>::FloatTensorPrimitive<D>,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn sigmoid_backward<const D: usize>( output: <B as Backend>::FloatTensorPrimitive<D>, grad: <B as Backend>::FloatTensorPrimitive<D>, ) -> <B as Backend>::FloatTensorPrimitive<D>
Applies the Sigmoid activation function backward. Read more
§fn hard_sigmoid<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
alpha: <B as Backend>::FloatElem,
beta: <B as Backend>::FloatElem,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn hard_sigmoid<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, alpha: <B as Backend>::FloatElem, beta: <B as Backend>::FloatElem, ) -> <B as Backend>::FloatTensorPrimitive<D>
Applies the hard Sigmoid activation function. Read more
§fn log_sigmoid<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn log_sigmoid<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, ) -> <B as Backend>::FloatTensorPrimitive<D>
Applies the LogSigmoid activation function. Read more
§fn log_sigmoid_backward<const D: usize>(
x: <B as Backend>::FloatTensorPrimitive<D>,
grad: <B as Backend>::FloatTensorPrimitive<D>,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn log_sigmoid_backward<const D: usize>( x: <B as Backend>::FloatTensorPrimitive<D>, grad: <B as Backend>::FloatTensorPrimitive<D>, ) -> <B as Backend>::FloatTensorPrimitive<D>
Applies the LogSigmoid activation function backward. Read more
§impl<E, Q> Backend for NdArray<E, Q>where
E: FloatNdArrayElement,
Q: QuantElement,
impl<E, Q> Backend for NdArray<E, Q>where
E: FloatNdArrayElement,
Q: QuantElement,
§type Device = NdArrayDevice
type Device = NdArrayDevice
Device type.
§type FullPrecisionBridge = PrecisionBridge<f32>
type FullPrecisionBridge = PrecisionBridge<f32>
A bridge that can cast tensors to full precision.
§type FloatTensorPrimitive<const D: usize> = NdArrayTensor<E, D>
type FloatTensorPrimitive<const D: usize> = NdArrayTensor<E, D>
Tensor primitive to be used for all float operations.
§type IntTensorPrimitive<const D: usize> = NdArrayTensor<i64, D>
type IntTensorPrimitive<const D: usize> = NdArrayTensor<i64, D>
Tensor primitive to be used for all int operations.
§type BoolTensorPrimitive<const D: usize> = NdArrayTensor<bool, D>
type BoolTensorPrimitive<const D: usize> = NdArrayTensor<bool, D>
Tensor primitive to be used for all bool operations.
§type QuantizedTensorPrimitive<const D: usize> = NdArrayQTensor<Q, D>
type QuantizedTensorPrimitive<const D: usize> = NdArrayQTensor<Q, D>
Tensor primitive to be used for all quantized operations.
§fn ad_enabled() -> bool
fn ad_enabled() -> bool
If autodiff is enabled.
§impl<TElem, OElem, QElem> BackendBridge<NdArray<OElem, QElem>> for PrecisionBridge<TElem>where
TElem: FloatNdArrayElement,
OElem: FloatNdArrayElement,
QElem: QuantElement,
impl<TElem, OElem, QElem> BackendBridge<NdArray<OElem, QElem>> for PrecisionBridge<TElem>where
TElem: FloatNdArrayElement,
OElem: FloatNdArrayElement,
QElem: QuantElement,
§fn into_target<const D: usize>(
tensor: <NdArray<OElem> as Backend>::FloatTensorPrimitive<D>,
_device: Option<NdArrayDevice>,
) -> <<PrecisionBridge<TElem> as BackendBridge<NdArray<OElem, QElem>>>::Target as Backend>::FloatTensorPrimitive<D>
fn into_target<const D: usize>( tensor: <NdArray<OElem> as Backend>::FloatTensorPrimitive<D>, _device: Option<NdArrayDevice>, ) -> <<PrecisionBridge<TElem> as BackendBridge<NdArray<OElem, QElem>>>::Target as Backend>::FloatTensorPrimitive<D>
Transfer the tensor to the target backend.
§fn from_target<const D: usize>(
tensor: <<PrecisionBridge<TElem> as BackendBridge<NdArray<OElem, QElem>>>::Target as Backend>::FloatTensorPrimitive<D>,
_device: Option<NdArrayDevice>,
) -> <NdArray<OElem> as Backend>::FloatTensorPrimitive<D>
fn from_target<const D: usize>( tensor: <<PrecisionBridge<TElem> as BackendBridge<NdArray<OElem, QElem>>>::Target as Backend>::FloatTensorPrimitive<D>, _device: Option<NdArrayDevice>, ) -> <NdArray<OElem> as Backend>::FloatTensorPrimitive<D>
Transfer the tensor from the target backend.
§impl<E, Q> BoolTensorOps<NdArray<E, Q>> for NdArray<E, Q>where
E: FloatNdArrayElement,
Q: QuantElement,
impl<E, Q> BoolTensorOps<NdArray<E, Q>> for NdArray<E, Q>where
E: FloatNdArrayElement,
Q: QuantElement,
§fn bool_from_data<const D: usize>(
data: TensorData,
_device: &NdArrayDevice,
) -> NdArrayTensor<bool, D>
fn bool_from_data<const D: usize>( data: TensorData, _device: &NdArrayDevice, ) -> NdArrayTensor<bool, D>
Creates a tensor from the data structure. Read more
§fn bool_shape<const D: usize>(
tensor: &<NdArray<E> as Backend>::BoolTensorPrimitive<D>,
) -> Shape<D>
fn bool_shape<const D: usize>( tensor: &<NdArray<E> as Backend>::BoolTensorPrimitive<D>, ) -> Shape<D>
Returns the shape of the tensor. Read more
§async fn bool_into_data<const D: usize>(
tensor: <NdArray<E> as Backend>::BoolTensorPrimitive<D>,
) -> TensorData
async fn bool_into_data<const D: usize>( tensor: <NdArray<E> as Backend>::BoolTensorPrimitive<D>, ) -> TensorData
Converts the tensor to a data structure. Read more
§fn bool_to_device<const D: usize>(
tensor: NdArrayTensor<bool, D>,
_device: &NdArrayDevice,
) -> NdArrayTensor<bool, D>
fn bool_to_device<const D: usize>( tensor: NdArrayTensor<bool, D>, _device: &NdArrayDevice, ) -> NdArrayTensor<bool, D>
Moves the tensor to the device.
§fn bool_reshape<const D1: usize, const D2: usize>(
tensor: NdArrayTensor<bool, D1>,
shape: Shape<D2>,
) -> NdArrayTensor<bool, D2>
fn bool_reshape<const D1: usize, const D2: usize>( tensor: NdArrayTensor<bool, D1>, shape: Shape<D2>, ) -> NdArrayTensor<bool, D2>
Reshapes the tensor. Read more
§fn bool_slice<const D1: usize, const D2: usize>(
tensor: NdArrayTensor<bool, D1>,
ranges: [Range<usize>; D2],
) -> NdArrayTensor<bool, D1>
fn bool_slice<const D1: usize, const D2: usize>( tensor: NdArrayTensor<bool, D1>, ranges: [Range<usize>; D2], ) -> NdArrayTensor<bool, D1>
Gets the values from the tensor for the given ranges. Read more
§fn bool_into_int<const D: usize>(
tensor: <NdArray<E> as Backend>::BoolTensorPrimitive<D>,
) -> NdArrayTensor<i64, D>
fn bool_into_int<const D: usize>( tensor: <NdArray<E> as Backend>::BoolTensorPrimitive<D>, ) -> NdArrayTensor<i64, D>
Converts bool tensor to int tensor. Read more
§fn bool_device<const D: usize>(
_tensor: &<NdArray<E> as Backend>::BoolTensorPrimitive<D>,
) -> <NdArray<E> as Backend>::Device
fn bool_device<const D: usize>( _tensor: &<NdArray<E> as Backend>::BoolTensorPrimitive<D>, ) -> <NdArray<E> as Backend>::Device
Gets the device of the tensor. Read more
§fn bool_empty<const D: usize>(
shape: Shape<D>,
_device: &<NdArray<E> as Backend>::Device,
) -> <NdArray<E> as Backend>::BoolTensorPrimitive<D>
fn bool_empty<const D: usize>( shape: Shape<D>, _device: &<NdArray<E> as Backend>::Device, ) -> <NdArray<E> as Backend>::BoolTensorPrimitive<D>
Creates a new bool tensor. Read more
§fn bool_slice_assign<const D1: usize, const D2: usize>(
tensor: <NdArray<E> as Backend>::BoolTensorPrimitive<D1>,
ranges: [Range<usize>; D2],
value: <NdArray<E> as Backend>::BoolTensorPrimitive<D1>,
) -> <NdArray<E> as Backend>::BoolTensorPrimitive<D1>
fn bool_slice_assign<const D1: usize, const D2: usize>( tensor: <NdArray<E> as Backend>::BoolTensorPrimitive<D1>, ranges: [Range<usize>; D2], value: <NdArray<E> as Backend>::BoolTensorPrimitive<D1>, ) -> <NdArray<E> as Backend>::BoolTensorPrimitive<D1>
Sets the values in the tensor for the given ranges. Read more
§fn bool_cat<const D: usize>(
tensors: Vec<<NdArray<E> as Backend>::BoolTensorPrimitive<D>>,
dim: usize,
) -> <NdArray<E> as Backend>::BoolTensorPrimitive<D>
fn bool_cat<const D: usize>( tensors: Vec<<NdArray<E> as Backend>::BoolTensorPrimitive<D>>, dim: usize, ) -> <NdArray<E> as Backend>::BoolTensorPrimitive<D>
Concatenates the tensors along the given dimension. Read more
§fn bool_equal<const D: usize>(
lhs: <NdArray<E> as Backend>::BoolTensorPrimitive<D>,
rhs: <NdArray<E> as Backend>::BoolTensorPrimitive<D>,
) -> <NdArray<E> as Backend>::BoolTensorPrimitive<D>
fn bool_equal<const D: usize>( lhs: <NdArray<E> as Backend>::BoolTensorPrimitive<D>, rhs: <NdArray<E> as Backend>::BoolTensorPrimitive<D>, ) -> <NdArray<E> as Backend>::BoolTensorPrimitive<D>
Equates the two tensors. Read more
§fn bool_not<const D: usize>(
tensor: <NdArray<E> as Backend>::BoolTensorPrimitive<D>,
) -> <NdArray<E> as Backend>::BoolTensorPrimitive<D>
fn bool_not<const D: usize>( tensor: <NdArray<E> as Backend>::BoolTensorPrimitive<D>, ) -> <NdArray<E> as Backend>::BoolTensorPrimitive<D>
Inverses boolean values. Read more
§fn bool_into_float<const D: usize>(
tensor: <NdArray<E> as Backend>::BoolTensorPrimitive<D>,
) -> <NdArray<E> as Backend>::FloatTensorPrimitive<D>
fn bool_into_float<const D: usize>( tensor: <NdArray<E> as Backend>::BoolTensorPrimitive<D>, ) -> <NdArray<E> as Backend>::FloatTensorPrimitive<D>
Converts bool tensor to float tensor. Read more
§fn bool_swap_dims<const D: usize>(
tensor: <NdArray<E> as Backend>::BoolTensorPrimitive<D>,
dim1: usize,
dim2: usize,
) -> <NdArray<E> as Backend>::BoolTensorPrimitive<D>
fn bool_swap_dims<const D: usize>( tensor: <NdArray<E> as Backend>::BoolTensorPrimitive<D>, dim1: usize, dim2: usize, ) -> <NdArray<E> as Backend>::BoolTensorPrimitive<D>
Swaps two dimensions of a bool tensor. Read more
§fn bool_permute<const D: usize>(
tensor: <NdArray<E, Q> as Backend>::BoolTensorPrimitive<D>,
axes: [usize; D],
) -> <NdArray<E, Q> as Backend>::BoolTensorPrimitive<D>
fn bool_permute<const D: usize>( tensor: <NdArray<E, Q> as Backend>::BoolTensorPrimitive<D>, axes: [usize; D], ) -> <NdArray<E, Q> as Backend>::BoolTensorPrimitive<D>
Permutes the dimensions of a tensor. Read more
§fn bool_expand<const D1: usize, const D2: usize>(
tensor: <NdArray<E, Q> as Backend>::BoolTensorPrimitive<D1>,
shape: Shape<D2>,
) -> <NdArray<E, Q> as Backend>::BoolTensorPrimitive<D2>
fn bool_expand<const D1: usize, const D2: usize>( tensor: <NdArray<E, Q> as Backend>::BoolTensorPrimitive<D1>, shape: Shape<D2>, ) -> <NdArray<E, Q> as Backend>::BoolTensorPrimitive<D2>
Broadcasts the bool
tensor
to the given shape
.§fn bool_flip<const D: usize>(
tensor: <NdArray<E, Q> as Backend>::BoolTensorPrimitive<D>,
axes: &[usize],
) -> <NdArray<E, Q> as Backend>::BoolTensorPrimitive<D>
fn bool_flip<const D: usize>( tensor: <NdArray<E, Q> as Backend>::BoolTensorPrimitive<D>, axes: &[usize], ) -> <NdArray<E, Q> as Backend>::BoolTensorPrimitive<D>
Reverse the order of elements in a tensor along the given axes. Read more
§fn bool_repeat_dim<const D: usize>(
tensor: <B as Backend>::BoolTensorPrimitive<D>,
dim: usize,
times: usize,
) -> <B as Backend>::BoolTensorPrimitive<D>
fn bool_repeat_dim<const D: usize>( tensor: <B as Backend>::BoolTensorPrimitive<D>, dim: usize, times: usize, ) -> <B as Backend>::BoolTensorPrimitive<D>
Repeats one dimension of the tensor a given number of times along that dimension. Read more
§fn bool_not_equal<const D: usize>(
lhs: <B as Backend>::BoolTensorPrimitive<D>,
rhs: <B as Backend>::BoolTensorPrimitive<D>,
) -> <B as Backend>::BoolTensorPrimitive<D>
fn bool_not_equal<const D: usize>( lhs: <B as Backend>::BoolTensorPrimitive<D>, rhs: <B as Backend>::BoolTensorPrimitive<D>, ) -> <B as Backend>::BoolTensorPrimitive<D>
Element-wise non-equality comparison. Read more
§fn bool_transpose<const D: usize>(
tensor: <B as Backend>::BoolTensorPrimitive<D>,
) -> <B as Backend>::BoolTensorPrimitive<D>
fn bool_transpose<const D: usize>( tensor: <B as Backend>::BoolTensorPrimitive<D>, ) -> <B as Backend>::BoolTensorPrimitive<D>
Transposes a bool tensor. Read more
§fn bool_narrow<const D: usize>(
tensor: <B as Backend>::BoolTensorPrimitive<D>,
dim: usize,
start: usize,
length: usize,
) -> <B as Backend>::BoolTensorPrimitive<D>
fn bool_narrow<const D: usize>( tensor: <B as Backend>::BoolTensorPrimitive<D>, dim: usize, start: usize, length: usize, ) -> <B as Backend>::BoolTensorPrimitive<D>
Returns a new tensor with the given dimension narrowed to the given range. Read more
§fn bool_chunk<const D: usize>(
tensor: <B as Backend>::BoolTensorPrimitive<D>,
chunks: usize,
dim: usize,
) -> Vec<<B as Backend>::BoolTensorPrimitive<D>>
fn bool_chunk<const D: usize>( tensor: <B as Backend>::BoolTensorPrimitive<D>, chunks: usize, dim: usize, ) -> Vec<<B as Backend>::BoolTensorPrimitive<D>>
Split the tensor along the given dimension into chunks. Read more
§fn bool_any<const D: usize>(
tensor: <B as Backend>::BoolTensorPrimitive<D>,
) -> <B as Backend>::BoolTensorPrimitive<1>
fn bool_any<const D: usize>( tensor: <B as Backend>::BoolTensorPrimitive<D>, ) -> <B as Backend>::BoolTensorPrimitive<1>
Tests if any element in the boolean
tensor
evaluates to True. Read more§fn bool_any_dim<const D: usize>(
tensor: <B as Backend>::BoolTensorPrimitive<D>,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive<D>
fn bool_any_dim<const D: usize>( tensor: <B as Backend>::BoolTensorPrimitive<D>, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive<D>
§fn bool_all<const D: usize>(
tensor: <B as Backend>::BoolTensorPrimitive<D>,
) -> <B as Backend>::BoolTensorPrimitive<1>
fn bool_all<const D: usize>( tensor: <B as Backend>::BoolTensorPrimitive<D>, ) -> <B as Backend>::BoolTensorPrimitive<1>
Tests if all elements in the boolean
tensor
evaluate to True. Read more§fn bool_all_dim<const D: usize>(
tensor: <B as Backend>::BoolTensorPrimitive<D>,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive<D>
fn bool_all_dim<const D: usize>( tensor: <B as Backend>::BoolTensorPrimitive<D>, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive<D>
§fn bool_argwhere<const D: usize>(
tensor: <B as Backend>::BoolTensorPrimitive<D>,
) -> impl Future<Output = <B as Backend>::IntTensorPrimitive<2>> + Send
fn bool_argwhere<const D: usize>( tensor: <B as Backend>::BoolTensorPrimitive<D>, ) -> impl Future<Output = <B as Backend>::IntTensorPrimitive<2>> + Send
Compute the indices of the elements that are non-zero, grouped by element. Read more
§fn bool_nonzero<const D: usize>(
tensor: <B as Backend>::BoolTensorPrimitive<D>,
) -> impl Future<Output = Vec<<B as Backend>::IntTensorPrimitive<1>>> + Send
fn bool_nonzero<const D: usize>( tensor: <B as Backend>::BoolTensorPrimitive<D>, ) -> impl Future<Output = Vec<<B as Backend>::IntTensorPrimitive<1>>> + Send
Compute the indices of the elements that are non-zero. Read more
§impl<E, Q> FloatTensorOps<NdArray<E, Q>> for NdArray<E, Q>where
E: FloatNdArrayElement,
Q: QuantElement,
impl<E, Q> FloatTensorOps<NdArray<E, Q>> for NdArray<E, Q>where
E: FloatNdArrayElement,
Q: QuantElement,
§fn float_from_data<const D: usize>(
data: TensorData,
_device: &NdArrayDevice,
) -> NdArrayTensor<E, D>
fn float_from_data<const D: usize>( data: TensorData, _device: &NdArrayDevice, ) -> NdArrayTensor<E, D>
Creates a new tensor from the data structure. Read more
§fn float_random<const D: usize>(
shape: Shape<D>,
distribution: Distribution,
device: &NdArrayDevice,
) -> NdArrayTensor<E, D>
fn float_random<const D: usize>( shape: Shape<D>, distribution: Distribution, device: &NdArrayDevice, ) -> NdArrayTensor<E, D>
Creates a new tensor with random values. Read more
§fn float_shape<const D: usize>(tensor: &NdArrayTensor<E, D>) -> Shape<D>
fn float_shape<const D: usize>(tensor: &NdArrayTensor<E, D>) -> Shape<D>
Gets the shape of the tensor. Read more
§async fn float_into_data<const D: usize>(
tensor: NdArrayTensor<E, D>,
) -> TensorData
async fn float_into_data<const D: usize>( tensor: NdArrayTensor<E, D>, ) -> TensorData
Converts the tensor to a data structure. Read more
§fn float_device<const D: usize>(_tensor: &NdArrayTensor<E, D>) -> NdArrayDevice
fn float_device<const D: usize>(_tensor: &NdArrayTensor<E, D>) -> NdArrayDevice
Gets the device of the tensor. Read more
§fn float_to_device<const D: usize>(
tensor: NdArrayTensor<E, D>,
_device: &NdArrayDevice,
) -> NdArrayTensor<E, D>
fn float_to_device<const D: usize>( tensor: NdArrayTensor<E, D>, _device: &NdArrayDevice, ) -> NdArrayTensor<E, D>
Moves the tensor to the given device. Read more
§fn float_empty<const D: usize>(
shape: Shape<D>,
device: &<NdArray<E> as Backend>::Device,
) -> NdArrayTensor<E, D>
fn float_empty<const D: usize>( shape: Shape<D>, device: &<NdArray<E> as Backend>::Device, ) -> NdArrayTensor<E, D>
Creates an empty tensor with the given shape. Read more
§fn float_add<const D: usize>(
lhs: NdArrayTensor<E, D>,
rhs: NdArrayTensor<E, D>,
) -> NdArrayTensor<E, D>
fn float_add<const D: usize>( lhs: NdArrayTensor<E, D>, rhs: NdArrayTensor<E, D>, ) -> NdArrayTensor<E, D>
Adds two tensors together. Read more
§fn float_add_scalar<const D: usize>(
lhs: NdArrayTensor<E, D>,
rhs: E,
) -> NdArrayTensor<E, D>
fn float_add_scalar<const D: usize>( lhs: NdArrayTensor<E, D>, rhs: E, ) -> NdArrayTensor<E, D>
Adds a scalar to a tensor. Read more
§fn float_sub<const D: usize>(
lhs: NdArrayTensor<E, D>,
rhs: NdArrayTensor<E, D>,
) -> NdArrayTensor<E, D>
fn float_sub<const D: usize>( lhs: NdArrayTensor<E, D>, rhs: NdArrayTensor<E, D>, ) -> NdArrayTensor<E, D>
Subtracts two tensors. Read more
§fn float_sub_scalar<const D: usize>(
lhs: NdArrayTensor<E, D>,
rhs: E,
) -> NdArrayTensor<E, D>
fn float_sub_scalar<const D: usize>( lhs: NdArrayTensor<E, D>, rhs: E, ) -> NdArrayTensor<E, D>
Subtracts a scalar from a tensor. Read more
§fn float_mul<const D: usize>(
lhs: NdArrayTensor<E, D>,
rhs: NdArrayTensor<E, D>,
) -> NdArrayTensor<E, D>
fn float_mul<const D: usize>( lhs: NdArrayTensor<E, D>, rhs: NdArrayTensor<E, D>, ) -> NdArrayTensor<E, D>
Multiplies two tensors together element-wise.
§fn float_mul_scalar<const D: usize>(
lhs: NdArrayTensor<E, D>,
rhs: E,
) -> NdArrayTensor<E, D>
fn float_mul_scalar<const D: usize>( lhs: NdArrayTensor<E, D>, rhs: E, ) -> NdArrayTensor<E, D>
Multiplies a tensor by a scalar. Read more
§fn float_div<const D: usize>(
lhs: NdArrayTensor<E, D>,
rhs: NdArrayTensor<E, D>,
) -> NdArrayTensor<E, D>
fn float_div<const D: usize>( lhs: NdArrayTensor<E, D>, rhs: NdArrayTensor<E, D>, ) -> NdArrayTensor<E, D>
Divides two tensors element-wise. Read more
§fn float_div_scalar<const D: usize>(
lhs: NdArrayTensor<E, D>,
rhs: E,
) -> NdArrayTensor<E, D>
fn float_div_scalar<const D: usize>( lhs: NdArrayTensor<E, D>, rhs: E, ) -> NdArrayTensor<E, D>
Divides a tensor by a scalar. Read more
§fn float_remainder_scalar<const D: usize>(
lhs: NdArrayTensor<E, D>,
rhs: E,
) -> NdArrayTensor<E, D>
fn float_remainder_scalar<const D: usize>( lhs: NdArrayTensor<E, D>, rhs: E, ) -> NdArrayTensor<E, D>
Computes the modulus of a tensor given a scalar. Read more
§fn float_matmul<const D: usize>(
lhs: NdArrayTensor<E, D>,
rhs: NdArrayTensor<E, D>,
) -> NdArrayTensor<E, D>
fn float_matmul<const D: usize>( lhs: NdArrayTensor<E, D>, rhs: NdArrayTensor<E, D>, ) -> NdArrayTensor<E, D>
Multiplies two tensors together using matrix multiplication. Read more
§fn float_neg<const D: usize>(tensor: NdArrayTensor<E, D>) -> NdArrayTensor<E, D>
fn float_neg<const D: usize>(tensor: NdArrayTensor<E, D>) -> NdArrayTensor<E, D>
Negates a tensor element-wise.
§fn float_recip<const D: usize>(
tensor: NdArrayTensor<E, D>,
) -> NdArrayTensor<E, D>
fn float_recip<const D: usize>( tensor: NdArrayTensor<E, D>, ) -> NdArrayTensor<E, D>
Calculates the reciprocals element-wise
§fn float_swap_dims<const D: usize>(
tensor: NdArrayTensor<E, D>,
dim1: usize,
dim2: usize,
) -> NdArrayTensor<E, D>
fn float_swap_dims<const D: usize>( tensor: NdArrayTensor<E, D>, dim1: usize, dim2: usize, ) -> NdArrayTensor<E, D>
Swaps two dimensions of a tensor. Read more
§fn float_reshape<const D1: usize, const D2: usize>(
tensor: NdArrayTensor<E, D1>,
shape: Shape<D2>,
) -> NdArrayTensor<E, D2>
fn float_reshape<const D1: usize, const D2: usize>( tensor: NdArrayTensor<E, D1>, shape: Shape<D2>, ) -> NdArrayTensor<E, D2>
Reshapes a tensor. Read more
§fn float_gather<const D: usize>(
dim: usize,
tensor: NdArrayTensor<E, D>,
indices: NdArrayTensor<i64, D>,
) -> NdArrayTensor<E, D>
fn float_gather<const D: usize>( dim: usize, tensor: NdArrayTensor<E, D>, indices: NdArrayTensor<i64, D>, ) -> NdArrayTensor<E, D>
Gather elements from a tensor. Read more
§fn float_scatter<const D: usize>(
dim: usize,
tensor: NdArrayTensor<E, D>,
indices: NdArrayTensor<i64, D>,
value: NdArrayTensor<E, D>,
) -> NdArrayTensor<E, D>
fn float_scatter<const D: usize>( dim: usize, tensor: NdArrayTensor<E, D>, indices: NdArrayTensor<i64, D>, value: NdArrayTensor<E, D>, ) -> NdArrayTensor<E, D>
Scatter elements into a tensor. Read more
§fn float_select<const D: usize>(
tensor: NdArrayTensor<E, D>,
dim: usize,
indices: NdArrayTensor<i64, 1>,
) -> NdArrayTensor<E, D>
fn float_select<const D: usize>( tensor: NdArrayTensor<E, D>, dim: usize, indices: NdArrayTensor<i64, 1>, ) -> NdArrayTensor<E, D>
Select tensor elements along the given dimension corresponding for the given indices. Read more
§fn float_select_assign<const D: usize>(
tensor: NdArrayTensor<E, D>,
dim: usize,
indices: NdArrayTensor<i64, 1>,
value: NdArrayTensor<E, D>,
) -> NdArrayTensor<E, D>
fn float_select_assign<const D: usize>( tensor: NdArrayTensor<E, D>, dim: usize, indices: NdArrayTensor<i64, 1>, value: NdArrayTensor<E, D>, ) -> NdArrayTensor<E, D>
Assign the selected elements along the given dimension corresponding for the given indices
to the given value. Read more
§fn float_slice<const D1: usize, const D2: usize>(
tensor: NdArrayTensor<E, D1>,
ranges: [Range<usize>; D2],
) -> NdArrayTensor<E, D1>
fn float_slice<const D1: usize, const D2: usize>( tensor: NdArrayTensor<E, D1>, ranges: [Range<usize>; D2], ) -> NdArrayTensor<E, D1>
Select tensor elements corresponding for the given ranges. Read more
§fn float_slice_assign<const D1: usize, const D2: usize>(
tensor: NdArrayTensor<E, D1>,
ranges: [Range<usize>; D2],
value: NdArrayTensor<E, D1>,
) -> NdArrayTensor<E, D1>
fn float_slice_assign<const D1: usize, const D2: usize>( tensor: NdArrayTensor<E, D1>, ranges: [Range<usize>; D2], value: NdArrayTensor<E, D1>, ) -> NdArrayTensor<E, D1>
Assign the selected elements corresponding for the given ranges to the given value. Read more
§fn float_mask_where<const D: usize>(
tensor: NdArrayTensor<E, D>,
mask: NdArrayTensor<bool, D>,
value: NdArrayTensor<E, D>,
) -> NdArrayTensor<E, D>
fn float_mask_where<const D: usize>( tensor: NdArrayTensor<E, D>, mask: NdArrayTensor<bool, D>, value: NdArrayTensor<E, D>, ) -> NdArrayTensor<E, D>
Update the given tensor with the value tensor where the mask is true. Read more
§fn float_mask_fill<const D: usize>(
tensor: NdArrayTensor<E, D>,
mask: NdArrayTensor<bool, D>,
value: E,
) -> NdArrayTensor<E, D>
fn float_mask_fill<const D: usize>( tensor: NdArrayTensor<E, D>, mask: NdArrayTensor<bool, D>, value: E, ) -> NdArrayTensor<E, D>
Update the given tensor with the value where the mask is true. Read more
§fn float_equal<const D: usize>(
lhs: NdArrayTensor<E, D>,
rhs: NdArrayTensor<E, D>,
) -> NdArrayTensor<bool, D>
fn float_equal<const D: usize>( lhs: NdArrayTensor<E, D>, rhs: NdArrayTensor<E, D>, ) -> NdArrayTensor<bool, D>
Equal comparison of two tensors. Read more
§fn float_equal_elem<const D: usize>(
lhs: NdArrayTensor<E, D>,
rhs: E,
) -> NdArrayTensor<bool, D>
fn float_equal_elem<const D: usize>( lhs: NdArrayTensor<E, D>, rhs: E, ) -> NdArrayTensor<bool, D>
Equal comparison of a tensor and a scalar. Read more
§fn float_greater<const D: usize>(
lhs: NdArrayTensor<E, D>,
rhs: NdArrayTensor<E, D>,
) -> NdArrayTensor<bool, D>
fn float_greater<const D: usize>( lhs: NdArrayTensor<E, D>, rhs: NdArrayTensor<E, D>, ) -> NdArrayTensor<bool, D>
Greater than comparison of two tensors. Read more
§fn float_greater_elem<const D: usize>(
lhs: NdArrayTensor<E, D>,
rhs: E,
) -> NdArrayTensor<bool, D>
fn float_greater_elem<const D: usize>( lhs: NdArrayTensor<E, D>, rhs: E, ) -> NdArrayTensor<bool, D>
Greater than comparison of a tensor and a scalar. Read more
§fn float_greater_equal<const D: usize>(
lhs: NdArrayTensor<E, D>,
rhs: NdArrayTensor<E, D>,
) -> NdArrayTensor<bool, D>
fn float_greater_equal<const D: usize>( lhs: NdArrayTensor<E, D>, rhs: NdArrayTensor<E, D>, ) -> NdArrayTensor<bool, D>
Greater than or equal comparison of two tensors. Read more
§fn float_greater_equal_elem<const D: usize>(
lhs: NdArrayTensor<E, D>,
rhs: E,
) -> NdArrayTensor<bool, D>
fn float_greater_equal_elem<const D: usize>( lhs: NdArrayTensor<E, D>, rhs: E, ) -> NdArrayTensor<bool, D>
Greater than or equal comparison of a tensor and a scalar. Read more
§fn float_lower<const D: usize>(
lhs: NdArrayTensor<E, D>,
rhs: NdArrayTensor<E, D>,
) -> NdArrayTensor<bool, D>
fn float_lower<const D: usize>( lhs: NdArrayTensor<E, D>, rhs: NdArrayTensor<E, D>, ) -> NdArrayTensor<bool, D>
Less than comparison of two tensors. Read more
§fn float_lower_elem<const D: usize>(
lhs: NdArrayTensor<E, D>,
rhs: E,
) -> NdArrayTensor<bool, D>
fn float_lower_elem<const D: usize>( lhs: NdArrayTensor<E, D>, rhs: E, ) -> NdArrayTensor<bool, D>
Less than comparison of a tensor and a scalar. Read more
§fn float_lower_equal<const D: usize>(
lhs: NdArrayTensor<E, D>,
rhs: NdArrayTensor<E, D>,
) -> NdArrayTensor<bool, D>
fn float_lower_equal<const D: usize>( lhs: NdArrayTensor<E, D>, rhs: NdArrayTensor<E, D>, ) -> NdArrayTensor<bool, D>
Less than or equal comparison of two tensors. Read more
§fn float_lower_equal_elem<const D: usize>(
lhs: NdArrayTensor<E, D>,
rhs: E,
) -> NdArrayTensor<bool, D>
fn float_lower_equal_elem<const D: usize>( lhs: NdArrayTensor<E, D>, rhs: E, ) -> NdArrayTensor<bool, D>
Less than or equal comparison of a tensor and a scalar. Read more
§fn float_detach<const D: usize>(
tensor: NdArrayTensor<E, D>,
) -> NdArrayTensor<E, D>
fn float_detach<const D: usize>( tensor: NdArrayTensor<E, D>, ) -> NdArrayTensor<E, D>
Detaches a tensor from the computation graph.
§fn float_mean<const D: usize>(
tensor: NdArrayTensor<E, D>,
) -> NdArrayTensor<E, 1>
fn float_mean<const D: usize>( tensor: NdArrayTensor<E, D>, ) -> NdArrayTensor<E, 1>
Mean of all elements in a tensor. Read more
§fn float_sum<const D: usize>(tensor: NdArrayTensor<E, D>) -> NdArrayTensor<E, 1>
fn float_sum<const D: usize>(tensor: NdArrayTensor<E, D>) -> NdArrayTensor<E, 1>
Sum of all elements in a tensor. Read more
§fn float_mean_dim<const D: usize>(
tensor: NdArrayTensor<E, D>,
dim: usize,
) -> NdArrayTensor<E, D>
fn float_mean_dim<const D: usize>( tensor: NdArrayTensor<E, D>, dim: usize, ) -> NdArrayTensor<E, D>
Mean of all elements in a tensor along a dimension. Read more
§fn float_sum_dim<const D: usize>(
tensor: NdArrayTensor<E, D>,
dim: usize,
) -> NdArrayTensor<E, D>
fn float_sum_dim<const D: usize>( tensor: NdArrayTensor<E, D>, dim: usize, ) -> NdArrayTensor<E, D>
Sum of all elements in a tensor along a dimension. Read more
§fn float_argmax<const D: usize>(
tensor: NdArrayTensor<E, D>,
dim: usize,
) -> NdArrayTensor<i64, D>
fn float_argmax<const D: usize>( tensor: NdArrayTensor<E, D>, dim: usize, ) -> NdArrayTensor<i64, D>
Gets the indices of the maximum elements of a tensor along an axis. Read more
§fn float_argmin<const D: usize>(
tensor: NdArrayTensor<E, D>,
dim: usize,
) -> NdArrayTensor<i64, D>
fn float_argmin<const D: usize>( tensor: NdArrayTensor<E, D>, dim: usize, ) -> NdArrayTensor<i64, D>
Gets the indices of the minimum elements of a tensor along an axis. Read more
§fn float_exp<const D: usize>(tensor: NdArrayTensor<E, D>) -> NdArrayTensor<E, D>
fn float_exp<const D: usize>(tensor: NdArrayTensor<E, D>) -> NdArrayTensor<E, D>
Returns a new tensor with exponential values. Read more
§fn float_log<const D: usize>(tensor: NdArrayTensor<E, D>) -> NdArrayTensor<E, D>
fn float_log<const D: usize>(tensor: NdArrayTensor<E, D>) -> NdArrayTensor<E, D>
Returns a new tensor with natural logarithm values. Read more
§fn float_log1p<const D: usize>(
tensor: NdArrayTensor<E, D>,
) -> NdArrayTensor<E, D>
fn float_log1p<const D: usize>( tensor: NdArrayTensor<E, D>, ) -> NdArrayTensor<E, D>
Returns a new tensor with logarithm values of (1 + Xi). Read more
§fn float_powf_scalar<const D: usize>(
tensor: NdArrayTensor<E, D>,
value: f32,
) -> NdArrayTensor<E, D>
fn float_powf_scalar<const D: usize>( tensor: NdArrayTensor<E, D>, value: f32, ) -> NdArrayTensor<E, D>
Returns a new tensor with values raised to the power of float
value
. Read more§fn float_sqrt<const D: usize>(
tensor: NdArrayTensor<E, D>,
) -> NdArrayTensor<E, D>
fn float_sqrt<const D: usize>( tensor: NdArrayTensor<E, D>, ) -> NdArrayTensor<E, D>
Returns a new tensor with square root values. Read more
§fn float_abs<const D: usize>(tensor: NdArrayTensor<E, D>) -> NdArrayTensor<E, D>
fn float_abs<const D: usize>(tensor: NdArrayTensor<E, D>) -> NdArrayTensor<E, D>
Returns a new tensor with absolute values. Read more
§fn float_cos<const D: usize>(tensor: NdArrayTensor<E, D>) -> NdArrayTensor<E, D>
fn float_cos<const D: usize>(tensor: NdArrayTensor<E, D>) -> NdArrayTensor<E, D>
Returns a new tensor with cosine values. Read more
§fn float_sin<const D: usize>(tensor: NdArrayTensor<E, D>) -> NdArrayTensor<E, D>
fn float_sin<const D: usize>(tensor: NdArrayTensor<E, D>) -> NdArrayTensor<E, D>
Returns a new tensor with sine values. Read more
§fn float_tanh<const D: usize>(
tensor: NdArrayTensor<E, D>,
) -> NdArrayTensor<E, D>
fn float_tanh<const D: usize>( tensor: NdArrayTensor<E, D>, ) -> NdArrayTensor<E, D>
Returns a new tensor with tangent values. Read more
§fn float_erf<const D: usize>(tensor: NdArrayTensor<E, D>) -> NdArrayTensor<E, D>
fn float_erf<const D: usize>(tensor: NdArrayTensor<E, D>) -> NdArrayTensor<E, D>
Returns a new tensor with the error function values. Read more
§fn float_cat<const D: usize>(
tensors: Vec<NdArrayTensor<E, D>>,
dim: usize,
) -> NdArrayTensor<E, D>
fn float_cat<const D: usize>( tensors: Vec<NdArrayTensor<E, D>>, dim: usize, ) -> NdArrayTensor<E, D>
Concatenates tensors along a dimension. Read more
§fn float_clamp_min<const D: usize>(
tensor: NdArrayTensor<E, D>,
min: E,
) -> NdArrayTensor<E, D>
fn float_clamp_min<const D: usize>( tensor: NdArrayTensor<E, D>, min: E, ) -> NdArrayTensor<E, D>
Clamps a tensor under a minimum value. Read more
§fn float_clamp_max<const D: usize>(
tensor: NdArrayTensor<E, D>,
max: E,
) -> NdArrayTensor<E, D>
fn float_clamp_max<const D: usize>( tensor: NdArrayTensor<E, D>, max: E, ) -> NdArrayTensor<E, D>
Clamps a tensor over a maximum value. Read more
§fn float_clamp<const D: usize>(
tensor: NdArrayTensor<E, D>,
min: E,
max: E,
) -> NdArrayTensor<E, D>
fn float_clamp<const D: usize>( tensor: NdArrayTensor<E, D>, min: E, max: E, ) -> NdArrayTensor<E, D>
Clamps a tensor between a minimum and maximum value. Read more
§fn float_into_int<const D: usize>(
tensor: <NdArray<E> as Backend>::FloatTensorPrimitive<D>,
) -> <NdArray<E> as Backend>::IntTensorPrimitive<D>
fn float_into_int<const D: usize>( tensor: <NdArray<E> as Backend>::FloatTensorPrimitive<D>, ) -> <NdArray<E> as Backend>::IntTensorPrimitive<D>
Converts float tensor to int tensor. Read more
§fn float_powf<const D: usize>(
lhs: NdArrayTensor<E, D>,
rhs: NdArrayTensor<E, D>,
) -> NdArrayTensor<E, D>
fn float_powf<const D: usize>( lhs: NdArrayTensor<E, D>, rhs: NdArrayTensor<E, D>, ) -> NdArrayTensor<E, D>
Element-wise power with a FloatTensor. Read more
§fn float_permute<const D: usize>(
tensor: <NdArray<E, Q> as Backend>::FloatTensorPrimitive<D>,
axes: [usize; D],
) -> <NdArray<E, Q> as Backend>::FloatTensorPrimitive<D>
fn float_permute<const D: usize>( tensor: <NdArray<E, Q> as Backend>::FloatTensorPrimitive<D>, axes: [usize; D], ) -> <NdArray<E, Q> as Backend>::FloatTensorPrimitive<D>
Permutes the dimensions of a tensor. Read more
§fn float_flip<const D: usize>(
tensor: <NdArray<E, Q> as Backend>::FloatTensorPrimitive<D>,
axes: &[usize],
) -> <NdArray<E, Q> as Backend>::FloatTensorPrimitive<D>
fn float_flip<const D: usize>( tensor: <NdArray<E, Q> as Backend>::FloatTensorPrimitive<D>, axes: &[usize], ) -> <NdArray<E, Q> as Backend>::FloatTensorPrimitive<D>
Reverse the order of elements in a tensor along the given axes. Read more
§fn float_sign<const D: usize>(
tensor: NdArrayTensor<E, D>,
) -> NdArrayTensor<E, D>
fn float_sign<const D: usize>( tensor: NdArrayTensor<E, D>, ) -> NdArrayTensor<E, D>
Returns the signs of the float
tensor
. Read more§fn float_expand<const D1: usize, const D2: usize>(
tensor: <NdArray<E, Q> as Backend>::FloatTensorPrimitive<D1>,
shape: Shape<D2>,
) -> <NdArray<E, Q> as Backend>::FloatTensorPrimitive<D2>
fn float_expand<const D1: usize, const D2: usize>( tensor: <NdArray<E, Q> as Backend>::FloatTensorPrimitive<D1>, shape: Shape<D2>, ) -> <NdArray<E, Q> as Backend>::FloatTensorPrimitive<D2>
Broadcasts the float
tensor
to the given shape
.§fn float_zeros<const D: usize>(
shape: Shape<D>,
device: &<B as Backend>::Device,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn float_zeros<const D: usize>( shape: Shape<D>, device: &<B as Backend>::Device, ) -> <B as Backend>::FloatTensorPrimitive<D>
Creates a new tensor with zeros. Read more
§fn float_ones<const D: usize>(
shape: Shape<D>,
device: &<B as Backend>::Device,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn float_ones<const D: usize>( shape: Shape<D>, device: &<B as Backend>::Device, ) -> <B as Backend>::FloatTensorPrimitive<D>
Creates a new tensor with ones. Read more
§fn float_full<const D: usize>(
shape: Shape<D>,
fill_value: <B as Backend>::FloatElem,
device: &<B as Backend>::Device,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn float_full<const D: usize>( shape: Shape<D>, fill_value: <B as Backend>::FloatElem, device: &<B as Backend>::Device, ) -> <B as Backend>::FloatTensorPrimitive<D>
Creates a tensor filled with given value. Read more
§fn float_repeat_dim<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
dim: usize,
times: usize,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn float_repeat_dim<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, dim: usize, times: usize, ) -> <B as Backend>::FloatTensorPrimitive<D>
Repeat the tensor along the given dimension. Read more
§fn float_transpose<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn float_transpose<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, ) -> <B as Backend>::FloatTensorPrimitive<D>
Transposes a tensor. Read more
§fn float_not_equal<const D: usize>(
lhs: <B as Backend>::FloatTensorPrimitive<D>,
rhs: <B as Backend>::FloatTensorPrimitive<D>,
) -> <B as Backend>::BoolTensorPrimitive<D>
fn float_not_equal<const D: usize>( lhs: <B as Backend>::FloatTensorPrimitive<D>, rhs: <B as Backend>::FloatTensorPrimitive<D>, ) -> <B as Backend>::BoolTensorPrimitive<D>
Element-wise non-equality comparison. Read more
§fn float_not_equal_elem<const D: usize>(
lhs: <B as Backend>::FloatTensorPrimitive<D>,
rhs: <B as Backend>::FloatElem,
) -> <B as Backend>::BoolTensorPrimitive<D>
fn float_not_equal_elem<const D: usize>( lhs: <B as Backend>::FloatTensorPrimitive<D>, rhs: <B as Backend>::FloatElem, ) -> <B as Backend>::BoolTensorPrimitive<D>
Element-wise non-equality comparison with a scalar. Read more
§fn float_set_require_grad<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
_require_grad: bool,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn float_set_require_grad<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, _require_grad: bool, ) -> <B as Backend>::FloatTensorPrimitive<D>
Sets the
require_grad
flag of a tensor.§fn float_is_require_grad<const D: usize>(
_tensor: &<B as Backend>::FloatTensorPrimitive<D>,
) -> bool
fn float_is_require_grad<const D: usize>( _tensor: &<B as Backend>::FloatTensorPrimitive<D>, ) -> bool
Returns the
require_grad
flag of a tensor.§fn float_prod<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
) -> <B as Backend>::FloatTensorPrimitive<1>
fn float_prod<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, ) -> <B as Backend>::FloatTensorPrimitive<1>
Product of all elements in a tensor. Read more
§fn float_prod_dim<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
dim: usize,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn float_prod_dim<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, dim: usize, ) -> <B as Backend>::FloatTensorPrimitive<D>
Product of all elements in a tensor along a dimension. Read more
§fn float_into_full_precision<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
) -> <<<B as Backend>::FullPrecisionBridge as BackendBridge<B>>::Target as Backend>::FloatTensorPrimitive<D>
fn float_into_full_precision<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, ) -> <<<B as Backend>::FullPrecisionBridge as BackendBridge<B>>::Target as Backend>::FloatTensorPrimitive<D>
Converts a tensor to full precision. Read more
§fn float_from_full_precision<const D: usize>(
tensor: <<<B as Backend>::FullPrecisionBridge as BackendBridge<B>>::Target as Backend>::FloatTensorPrimitive<D>,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn float_from_full_precision<const D: usize>( tensor: <<<B as Backend>::FullPrecisionBridge as BackendBridge<B>>::Target as Backend>::FloatTensorPrimitive<D>, ) -> <B as Backend>::FloatTensorPrimitive<D>
Converts a tensor from full precision. Read more
§fn float_powi<const D: usize>(
lhs: <B as Backend>::FloatTensorPrimitive<D>,
rhs: <B as Backend>::IntTensorPrimitive<D>,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn float_powi<const D: usize>( lhs: <B as Backend>::FloatTensorPrimitive<D>, rhs: <B as Backend>::IntTensorPrimitive<D>, ) -> <B as Backend>::FloatTensorPrimitive<D>
Element-wise power with an IntTensor. Read more
§fn float_powi_scalar<const D: usize>(
lhs: <B as Backend>::FloatTensorPrimitive<D>,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn float_powi_scalar<const D: usize>( lhs: <B as Backend>::FloatTensorPrimitive<D>, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::FloatTensorPrimitive<D>
raises a tensor to the power of an int scalar. Read more
§fn float_max<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
) -> <B as Backend>::FloatTensorPrimitive<1>
fn float_max<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, ) -> <B as Backend>::FloatTensorPrimitive<1>
Gets the maximum element of a tensor. Read more
§fn float_max_dim<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
dim: usize,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn float_max_dim<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, dim: usize, ) -> <B as Backend>::FloatTensorPrimitive<D>
Gets the maximum elements of a tensor along an axis. Read more
§fn float_max_dim_with_indices<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
dim: usize,
) -> (<B as Backend>::FloatTensorPrimitive<D>, <B as Backend>::IntTensorPrimitive<D>)
fn float_max_dim_with_indices<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, dim: usize, ) -> (<B as Backend>::FloatTensorPrimitive<D>, <B as Backend>::IntTensorPrimitive<D>)
Gets the maximum elements of a tensor along an axis and their indices. Read more
§fn float_min<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
) -> <B as Backend>::FloatTensorPrimitive<1>
fn float_min<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, ) -> <B as Backend>::FloatTensorPrimitive<1>
Gets the minimum element of a tensor. Read more
§fn float_min_dim<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
dim: usize,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn float_min_dim<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, dim: usize, ) -> <B as Backend>::FloatTensorPrimitive<D>
Gets the minimum elements of a tensor along an axis. Read more
§fn float_min_dim_with_indices<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
dim: usize,
) -> (<B as Backend>::FloatTensorPrimitive<D>, <B as Backend>::IntTensorPrimitive<D>)
fn float_min_dim_with_indices<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, dim: usize, ) -> (<B as Backend>::FloatTensorPrimitive<D>, <B as Backend>::IntTensorPrimitive<D>)
Gets the minimum elements of a tensor along an axis and their indices. Read more
§fn float_narrow<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
dim: usize,
start: usize,
length: usize,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn float_narrow<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, dim: usize, start: usize, length: usize, ) -> <B as Backend>::FloatTensorPrimitive<D>
Returns a new tensor with the given dimension narrowed to the given range. Read more
§fn float_chunk<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
chunks: usize,
dim: usize,
) -> Vec<<B as Backend>::FloatTensorPrimitive<D>>
fn float_chunk<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, chunks: usize, dim: usize, ) -> Vec<<B as Backend>::FloatTensorPrimitive<D>>
Split the tensor along the given dimension into chunks. Read more
§fn float_any<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
) -> <B as Backend>::BoolTensorPrimitive<1>
fn float_any<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, ) -> <B as Backend>::BoolTensorPrimitive<1>
Tests if any element in the float
tensor
evaluates to True. Read more§fn float_any_dim<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive<D>
fn float_any_dim<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive<D>
§fn float_all<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
) -> <B as Backend>::BoolTensorPrimitive<1>
fn float_all<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, ) -> <B as Backend>::BoolTensorPrimitive<1>
Tests if all elements in the float
tensor
evaluate to True. Read more§fn float_all_dim<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive<D>
fn float_all_dim<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive<D>
§fn float_sort<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
dim: usize,
descending: bool,
) -> <B as Backend>::FloatTensorPrimitive<D>
fn float_sort<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, dim: usize, descending: bool, ) -> <B as Backend>::FloatTensorPrimitive<D>
Sort the elements of the input
tensor
by value in along a given dimension. Read more§fn float_sort_with_indices<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
dim: usize,
descending: bool,
) -> (<B as Backend>::FloatTensorPrimitive<D>, <B as Backend>::IntTensorPrimitive<D>)
fn float_sort_with_indices<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, dim: usize, descending: bool, ) -> (<B as Backend>::FloatTensorPrimitive<D>, <B as Backend>::IntTensorPrimitive<D>)
Sort the elements of the input
tensor
by value in along a given dimension. Read more§fn float_argsort<const D: usize>(
tensor: <B as Backend>::FloatTensorPrimitive<D>,
dim: usize,
descending: bool,
) -> <B as Backend>::IntTensorPrimitive<D>
fn float_argsort<const D: usize>( tensor: <B as Backend>::FloatTensorPrimitive<D>, dim: usize, descending: bool, ) -> <B as Backend>::IntTensorPrimitive<D>
Returns the indices that sort the elements of the input
tensor
by value along a given dimension. Read more§impl<E, Q> IntTensorOps<NdArray<E, Q>> for NdArray<E, Q>where
E: FloatNdArrayElement,
Q: QuantElement,
impl<E, Q> IntTensorOps<NdArray<E, Q>> for NdArray<E, Q>where
E: FloatNdArrayElement,
Q: QuantElement,
§fn int_from_data<const D: usize>(
data: TensorData,
_device: &NdArrayDevice,
) -> NdArrayTensor<i64, D>
fn int_from_data<const D: usize>( data: TensorData, _device: &NdArrayDevice, ) -> NdArrayTensor<i64, D>
Creates a tensor from the data structure. Read more
§fn int_shape<const D: usize>(tensor: &NdArrayTensor<i64, D>) -> Shape<D>
fn int_shape<const D: usize>(tensor: &NdArrayTensor<i64, D>) -> Shape<D>
Returns the shape of the tensor. Read more
§async fn int_into_data<const D: usize>(
tensor: NdArrayTensor<i64, D>,
) -> TensorData
async fn int_into_data<const D: usize>( tensor: NdArrayTensor<i64, D>, ) -> TensorData
Converts the tensor to a data structure. Read more
§fn int_to_device<const D: usize>(
tensor: NdArrayTensor<i64, D>,
_device: &NdArrayDevice,
) -> NdArrayTensor<i64, D>
fn int_to_device<const D: usize>( tensor: NdArrayTensor<i64, D>, _device: &NdArrayDevice, ) -> NdArrayTensor<i64, D>
Moves the tensor to the given device.
§fn int_reshape<const D1: usize, const D2: usize>(
tensor: NdArrayTensor<i64, D1>,
shape: Shape<D2>,
) -> NdArrayTensor<i64, D2>
fn int_reshape<const D1: usize, const D2: usize>( tensor: NdArrayTensor<i64, D1>, shape: Shape<D2>, ) -> NdArrayTensor<i64, D2>
Reshapes the tensor. Read more
§fn int_slice<const D1: usize, const D2: usize>(
tensor: NdArrayTensor<i64, D1>,
ranges: [Range<usize>; D2],
) -> NdArrayTensor<i64, D1>
fn int_slice<const D1: usize, const D2: usize>( tensor: NdArrayTensor<i64, D1>, ranges: [Range<usize>; D2], ) -> NdArrayTensor<i64, D1>
Gets the element at the given indices. Read more
§fn int_device<const D: usize>(
_tensor: &NdArrayTensor<i64, D>,
) -> <NdArray<E> as Backend>::Device
fn int_device<const D: usize>( _tensor: &NdArrayTensor<i64, D>, ) -> <NdArray<E> as Backend>::Device
Gets the device of the tensor. Read more
§fn int_empty<const D: usize>(
shape: Shape<D>,
_device: &<NdArray<E> as Backend>::Device,
) -> NdArrayTensor<i64, D>
fn int_empty<const D: usize>( shape: Shape<D>, _device: &<NdArray<E> as Backend>::Device, ) -> NdArrayTensor<i64, D>
Creates a new int tensor. Read more
§fn int_mask_where<const D: usize>(
tensor: NdArrayTensor<i64, D>,
mask: NdArrayTensor<bool, D>,
source: NdArrayTensor<i64, D>,
) -> NdArrayTensor<i64, D>
fn int_mask_where<const D: usize>( tensor: NdArrayTensor<i64, D>, mask: NdArrayTensor<bool, D>, source: NdArrayTensor<i64, D>, ) -> NdArrayTensor<i64, D>
Fills the tensor with values from the source tensor if the mask is true at the given
indices. Read more
§fn int_mask_fill<const D: usize>(
tensor: NdArrayTensor<i64, D>,
mask: NdArrayTensor<bool, D>,
value: i64,
) -> NdArrayTensor<i64, D>
fn int_mask_fill<const D: usize>( tensor: NdArrayTensor<i64, D>, mask: NdArrayTensor<bool, D>, value: i64, ) -> NdArrayTensor<i64, D>
Fills the tensor with the given value if the mask is true at the given indices. Read more
§fn int_slice_assign<const D1: usize, const D2: usize>(
tensor: NdArrayTensor<i64, D1>,
ranges: [Range<usize>; D2],
value: NdArrayTensor<i64, D1>,
) -> NdArrayTensor<i64, D1>
fn int_slice_assign<const D1: usize, const D2: usize>( tensor: NdArrayTensor<i64, D1>, ranges: [Range<usize>; D2], value: NdArrayTensor<i64, D1>, ) -> NdArrayTensor<i64, D1>
Sets the element at the given indices. Read more
§fn int_cat<const D: usize>(
tensors: Vec<NdArrayTensor<i64, D>>,
dim: usize,
) -> NdArrayTensor<i64, D>
fn int_cat<const D: usize>( tensors: Vec<NdArrayTensor<i64, D>>, dim: usize, ) -> NdArrayTensor<i64, D>
Concatenates the given tensors along the given dimension. Read more
§fn int_equal<const D: usize>(
lhs: NdArrayTensor<i64, D>,
rhs: NdArrayTensor<i64, D>,
) -> NdArrayTensor<bool, D>
fn int_equal<const D: usize>( lhs: NdArrayTensor<i64, D>, rhs: NdArrayTensor<i64, D>, ) -> NdArrayTensor<bool, D>
Element-wise equality comparison. Read more
§fn int_equal_elem<const D: usize>(
lhs: NdArrayTensor<i64, D>,
rhs: i64,
) -> NdArrayTensor<bool, D>
fn int_equal_elem<const D: usize>( lhs: NdArrayTensor<i64, D>, rhs: i64, ) -> NdArrayTensor<bool, D>
Element-wise equality comparison with a scalar. Read more
§fn int_greater<const D: usize>(
lhs: NdArrayTensor<i64, D>,
rhs: NdArrayTensor<i64, D>,
) -> NdArrayTensor<bool, D>
fn int_greater<const D: usize>( lhs: NdArrayTensor<i64, D>, rhs: NdArrayTensor<i64, D>, ) -> NdArrayTensor<bool, D>
Element-wise greater than comparison. Read more
§fn int_greater_elem<const D: usize>(
lhs: NdArrayTensor<i64, D>,
rhs: i64,
) -> NdArrayTensor<bool, D>
fn int_greater_elem<const D: usize>( lhs: NdArrayTensor<i64, D>, rhs: i64, ) -> NdArrayTensor<bool, D>
Element-wise greater than comparison with a scalar. Read more
§fn int_greater_equal<const D: usize>(
lhs: NdArrayTensor<i64, D>,
rhs: NdArrayTensor<i64, D>,
) -> NdArrayTensor<bool, D>
fn int_greater_equal<const D: usize>( lhs: NdArrayTensor<i64, D>, rhs: NdArrayTensor<i64, D>, ) -> NdArrayTensor<bool, D>
Element-wise greater than or equal comparison. Read more
§fn int_greater_equal_elem<const D: usize>(
lhs: NdArrayTensor<i64, D>,
rhs: i64,
) -> NdArrayTensor<bool, D>
fn int_greater_equal_elem<const D: usize>( lhs: NdArrayTensor<i64, D>, rhs: i64, ) -> NdArrayTensor<bool, D>
Element-wise greater than or equal comparison with a scalar. Read more
§fn int_lower<const D: usize>(
lhs: NdArrayTensor<i64, D>,
rhs: NdArrayTensor<i64, D>,
) -> NdArrayTensor<bool, D>
fn int_lower<const D: usize>( lhs: NdArrayTensor<i64, D>, rhs: NdArrayTensor<i64, D>, ) -> NdArrayTensor<bool, D>
Element-wise less than comparison. Read more
§fn int_lower_elem<const D: usize>(
lhs: NdArrayTensor<i64, D>,
rhs: i64,
) -> NdArrayTensor<bool, D>
fn int_lower_elem<const D: usize>( lhs: NdArrayTensor<i64, D>, rhs: i64, ) -> NdArrayTensor<bool, D>
Element-wise less than comparison with a scalar. Read more
§fn int_lower_equal<const D: usize>(
lhs: NdArrayTensor<i64, D>,
rhs: NdArrayTensor<i64, D>,
) -> NdArrayTensor<bool, D>
fn int_lower_equal<const D: usize>( lhs: NdArrayTensor<i64, D>, rhs: NdArrayTensor<i64, D>, ) -> NdArrayTensor<bool, D>
Element-wise less than or equal comparison. Read more
§fn int_lower_equal_elem<const D: usize>(
lhs: NdArrayTensor<i64, D>,
rhs: i64,
) -> NdArrayTensor<bool, D>
fn int_lower_equal_elem<const D: usize>( lhs: NdArrayTensor<i64, D>, rhs: i64, ) -> NdArrayTensor<bool, D>
Element-wise less than or equal comparison with a scalar. Read more
§fn int_add<const D: usize>(
lhs: NdArrayTensor<i64, D>,
rhs: NdArrayTensor<i64, D>,
) -> NdArrayTensor<i64, D>
fn int_add<const D: usize>( lhs: NdArrayTensor<i64, D>, rhs: NdArrayTensor<i64, D>, ) -> NdArrayTensor<i64, D>
Element-wise addition. Read more
§fn int_add_scalar<const D: usize>(
lhs: NdArrayTensor<i64, D>,
rhs: i64,
) -> NdArrayTensor<i64, D>
fn int_add_scalar<const D: usize>( lhs: NdArrayTensor<i64, D>, rhs: i64, ) -> NdArrayTensor<i64, D>
Element-wise addition with a scalar. Read more
§fn int_sub<const D: usize>(
lhs: NdArrayTensor<i64, D>,
rhs: NdArrayTensor<i64, D>,
) -> NdArrayTensor<i64, D>
fn int_sub<const D: usize>( lhs: NdArrayTensor<i64, D>, rhs: NdArrayTensor<i64, D>, ) -> NdArrayTensor<i64, D>
Element-wise subtraction. Read more
§fn int_sub_scalar<const D: usize>(
lhs: NdArrayTensor<i64, D>,
rhs: i64,
) -> NdArrayTensor<i64, D>
fn int_sub_scalar<const D: usize>( lhs: NdArrayTensor<i64, D>, rhs: i64, ) -> NdArrayTensor<i64, D>
Element-wise subtraction with a scalar. Read more
§fn int_mul<const D: usize>(
lhs: NdArrayTensor<i64, D>,
rhs: NdArrayTensor<i64, D>,
) -> NdArrayTensor<i64, D>
fn int_mul<const D: usize>( lhs: NdArrayTensor<i64, D>, rhs: NdArrayTensor<i64, D>, ) -> NdArrayTensor<i64, D>
Element-wise multiplication. Read more
§fn int_mul_scalar<const D: usize>(
lhs: NdArrayTensor<i64, D>,
rhs: i64,
) -> NdArrayTensor<i64, D>
fn int_mul_scalar<const D: usize>( lhs: NdArrayTensor<i64, D>, rhs: i64, ) -> NdArrayTensor<i64, D>
Element-wise multiplication with a scalar. Read more
§fn int_div<const D: usize>(
lhs: NdArrayTensor<i64, D>,
rhs: NdArrayTensor<i64, D>,
) -> NdArrayTensor<i64, D>
fn int_div<const D: usize>( lhs: NdArrayTensor<i64, D>, rhs: NdArrayTensor<i64, D>, ) -> NdArrayTensor<i64, D>
Element-wise division. Read more
§fn int_div_scalar<const D: usize>(
lhs: NdArrayTensor<i64, D>,
rhs: i64,
) -> NdArrayTensor<i64, D>
fn int_div_scalar<const D: usize>( lhs: NdArrayTensor<i64, D>, rhs: i64, ) -> NdArrayTensor<i64, D>
Element-wise division with a scalar. Read more
§fn int_remainder_scalar<const D: usize>(
lhs: NdArrayTensor<i64, D>,
rhs: i64,
) -> NdArrayTensor<i64, D>
fn int_remainder_scalar<const D: usize>( lhs: NdArrayTensor<i64, D>, rhs: i64, ) -> NdArrayTensor<i64, D>
Element-wise modulus with a scalar. Read more
§fn int_neg<const D: usize>(
tensor: NdArrayTensor<i64, D>,
) -> NdArrayTensor<i64, D>
fn int_neg<const D: usize>( tensor: NdArrayTensor<i64, D>, ) -> NdArrayTensor<i64, D>
Element-wise negation. Read more
§fn int_zeros<const D: usize>(
shape: Shape<D>,
device: &<NdArray<E> as Backend>::Device,
) -> NdArrayTensor<i64, D>
fn int_zeros<const D: usize>( shape: Shape<D>, device: &<NdArray<E> as Backend>::Device, ) -> NdArrayTensor<i64, D>
Creates a tensor of zeros. Read more
§fn int_ones<const D: usize>(
shape: Shape<D>,
device: &<NdArray<E> as Backend>::Device,
) -> NdArrayTensor<i64, D>
fn int_ones<const D: usize>( shape: Shape<D>, device: &<NdArray<E> as Backend>::Device, ) -> NdArrayTensor<i64, D>
Creates a tensor of ones. Read more
§fn int_full<const D: usize>(
shape: Shape<D>,
fill_value: i64,
device: &<NdArray<E> as Backend>::Device,
) -> NdArrayTensor<i64, D>
fn int_full<const D: usize>( shape: Shape<D>, fill_value: i64, device: &<NdArray<E> as Backend>::Device, ) -> NdArrayTensor<i64, D>
Creates a tensor filled with given value. Read more
§fn int_sum<const D: usize>(
tensor: NdArrayTensor<i64, D>,
) -> NdArrayTensor<i64, 1>
fn int_sum<const D: usize>( tensor: NdArrayTensor<i64, D>, ) -> NdArrayTensor<i64, 1>
Sums all elements in the tensor. Read more
§fn int_sum_dim<const D: usize>(
tensor: NdArrayTensor<i64, D>,
dim: usize,
) -> NdArrayTensor<i64, D>
fn int_sum_dim<const D: usize>( tensor: NdArrayTensor<i64, D>, dim: usize, ) -> NdArrayTensor<i64, D>
Sums all elements in the tensor along a dimension. Read more
§fn int_prod<const D: usize>(
tensor: NdArrayTensor<i64, D>,
) -> NdArrayTensor<i64, 1>
fn int_prod<const D: usize>( tensor: NdArrayTensor<i64, D>, ) -> NdArrayTensor<i64, 1>
Computes the product of all elements in the tensor. Read more
§fn int_prod_dim<const D: usize>(
tensor: NdArrayTensor<i64, D>,
dim: usize,
) -> NdArrayTensor<i64, D>
fn int_prod_dim<const D: usize>( tensor: NdArrayTensor<i64, D>, dim: usize, ) -> NdArrayTensor<i64, D>
Computes the product of all elements in the tensor along a dimension. Read more
§fn int_mean<const D: usize>(
tensor: NdArrayTensor<i64, D>,
) -> NdArrayTensor<i64, 1>
fn int_mean<const D: usize>( tensor: NdArrayTensor<i64, D>, ) -> NdArrayTensor<i64, 1>
Computes the mean of all elements in the tensor. Read more
§fn int_mean_dim<const D: usize>(
tensor: NdArrayTensor<i64, D>,
dim: usize,
) -> NdArrayTensor<i64, D>
fn int_mean_dim<const D: usize>( tensor: NdArrayTensor<i64, D>, dim: usize, ) -> NdArrayTensor<i64, D>
Computes the mean of all elements in the tensor along a dimension. Read more
§fn int_gather<const D: usize>(
dim: usize,
tensor: NdArrayTensor<i64, D>,
indices: NdArrayTensor<i64, D>,
) -> NdArrayTensor<i64, D>
fn int_gather<const D: usize>( dim: usize, tensor: NdArrayTensor<i64, D>, indices: NdArrayTensor<i64, D>, ) -> NdArrayTensor<i64, D>
Gather elements from the tensor at the given indices. Read more
§fn int_scatter<const D: usize>(
dim: usize,
tensor: NdArrayTensor<i64, D>,
indices: NdArrayTensor<i64, D>,
value: NdArrayTensor<i64, D>,
) -> NdArrayTensor<i64, D>
fn int_scatter<const D: usize>( dim: usize, tensor: NdArrayTensor<i64, D>, indices: NdArrayTensor<i64, D>, value: NdArrayTensor<i64, D>, ) -> NdArrayTensor<i64, D>
Scatter a given value to the tensor at the given indices. Read more
§fn int_select<const D: usize>(
tensor: NdArrayTensor<i64, D>,
dim: usize,
indices: NdArrayTensor<i64, 1>,
) -> NdArrayTensor<i64, D>
fn int_select<const D: usize>( tensor: NdArrayTensor<i64, D>, dim: usize, indices: NdArrayTensor<i64, 1>, ) -> NdArrayTensor<i64, D>
Select tensor elements along the given dimension corresponding to the given indices. Read more
§fn int_select_assign<const D: usize>(
tensor: NdArrayTensor<i64, D>,
dim: usize,
indices: NdArrayTensor<i64, 1>,
value: NdArrayTensor<i64, D>,
) -> NdArrayTensor<i64, D>
fn int_select_assign<const D: usize>( tensor: NdArrayTensor<i64, D>, dim: usize, indices: NdArrayTensor<i64, 1>, value: NdArrayTensor<i64, D>, ) -> NdArrayTensor<i64, D>
Assign the selected elements along the given dimension corresponding to the given indices
to the given value. Read more
§fn int_argmax<const D: usize>(
tensor: NdArrayTensor<i64, D>,
dim: usize,
) -> NdArrayTensor<i64, D>
fn int_argmax<const D: usize>( tensor: NdArrayTensor<i64, D>, dim: usize, ) -> NdArrayTensor<i64, D>
Gets the indices of the maximum elements along a dimension. Read more
§fn int_argmin<const D: usize>(
tensor: NdArrayTensor<i64, D>,
dim: usize,
) -> NdArrayTensor<i64, D>
fn int_argmin<const D: usize>( tensor: NdArrayTensor<i64, D>, dim: usize, ) -> NdArrayTensor<i64, D>
Gets the indices of the minimum elements along a dimension. Read more
§fn int_clamp_min<const D: usize>(
tensor: NdArrayTensor<i64, D>,
min: i64,
) -> NdArrayTensor<i64, D>
fn int_clamp_min<const D: usize>( tensor: NdArrayTensor<i64, D>, min: i64, ) -> NdArrayTensor<i64, D>
Clamps a tensor under a minimum value. Read more
§fn int_clamp_max<const D: usize>(
tensor: NdArrayTensor<i64, D>,
max: i64,
) -> NdArrayTensor<i64, D>
fn int_clamp_max<const D: usize>( tensor: NdArrayTensor<i64, D>, max: i64, ) -> NdArrayTensor<i64, D>
Clamps a tensor over a maximum value. Read more
§fn int_clamp<const D: usize>(
tensor: NdArrayTensor<i64, D>,
min: i64,
max: i64,
) -> NdArrayTensor<i64, D>
fn int_clamp<const D: usize>( tensor: NdArrayTensor<i64, D>, min: i64, max: i64, ) -> NdArrayTensor<i64, D>
Clamps a tensor between a minimum and maximum value. Read more
§fn int_abs<const D: usize>(
tensor: NdArrayTensor<i64, D>,
) -> NdArrayTensor<i64, D>
fn int_abs<const D: usize>( tensor: NdArrayTensor<i64, D>, ) -> NdArrayTensor<i64, D>
Returns a new tensor with absolute values. Read more
§fn int_into_float<const D: usize>(
tensor: <NdArray<E> as Backend>::IntTensorPrimitive<D>,
) -> <NdArray<E> as Backend>::FloatTensorPrimitive<D>
fn int_into_float<const D: usize>( tensor: <NdArray<E> as Backend>::IntTensorPrimitive<D>, ) -> <NdArray<E> as Backend>::FloatTensorPrimitive<D>
Converts int tensor to float tensor. Read more
§fn int_swap_dims<const D: usize>(
tensor: <NdArray<E> as Backend>::IntTensorPrimitive<D>,
dim1: usize,
dim2: usize,
) -> <NdArray<E> as Backend>::IntTensorPrimitive<D>
fn int_swap_dims<const D: usize>( tensor: <NdArray<E> as Backend>::IntTensorPrimitive<D>, dim1: usize, dim2: usize, ) -> <NdArray<E> as Backend>::IntTensorPrimitive<D>
Swaps two dimensions of an int tensor. Read more
§fn int_random<const D: usize>(
shape: Shape<D>,
distribution: Distribution,
device: &NdArrayDevice,
) -> NdArrayTensor<i64, D>
fn int_random<const D: usize>( shape: Shape<D>, distribution: Distribution, device: &NdArrayDevice, ) -> NdArrayTensor<i64, D>
Creates a new int tensor with random values. Read more
§fn int_powi<const D: usize>(
lhs: NdArrayTensor<i64, D>,
rhs: NdArrayTensor<i64, D>,
) -> NdArrayTensor<i64, D>
fn int_powi<const D: usize>( lhs: NdArrayTensor<i64, D>, rhs: NdArrayTensor<i64, D>, ) -> NdArrayTensor<i64, D>
Element-wise power with a IntTensor. Read more
§fn int_powf<const D: usize>(
lhs: NdArrayTensor<i64, D>,
rhs: NdArrayTensor<E, D>,
) -> NdArrayTensor<i64, D>
fn int_powf<const D: usize>( lhs: NdArrayTensor<i64, D>, rhs: NdArrayTensor<E, D>, ) -> NdArrayTensor<i64, D>
Element-wise power with a floatTensor. Read more
§fn int_powf_scalar<const D: usize>(
lhs: NdArrayTensor<i64, D>,
rhs: f32,
) -> NdArrayTensor<i64, D>
fn int_powf_scalar<const D: usize>( lhs: NdArrayTensor<i64, D>, rhs: f32, ) -> NdArrayTensor<i64, D>
Element-wise power with a floatTensor. Read more
§fn int_permute<const D: usize>(
tensor: <NdArray<E, Q> as Backend>::IntTensorPrimitive<D>,
axes: [usize; D],
) -> <NdArray<E, Q> as Backend>::IntTensorPrimitive<D>
fn int_permute<const D: usize>( tensor: <NdArray<E, Q> as Backend>::IntTensorPrimitive<D>, axes: [usize; D], ) -> <NdArray<E, Q> as Backend>::IntTensorPrimitive<D>
Permutes the dimensions of a tensor. Read more
§fn int_flip<const D: usize>(
tensor: <NdArray<E, Q> as Backend>::IntTensorPrimitive<D>,
axes: &[usize],
) -> <NdArray<E, Q> as Backend>::IntTensorPrimitive<D>
fn int_flip<const D: usize>( tensor: <NdArray<E, Q> as Backend>::IntTensorPrimitive<D>, axes: &[usize], ) -> <NdArray<E, Q> as Backend>::IntTensorPrimitive<D>
Reverse the order of elements in a tensor along the given axes. Read more
§fn int_sign<const D: usize>(
tensor: NdArrayTensor<i64, D>,
) -> NdArrayTensor<i64, D>
fn int_sign<const D: usize>( tensor: NdArrayTensor<i64, D>, ) -> NdArrayTensor<i64, D>
Returns the signs of the int
tensor
. Read more§fn int_expand<const D1: usize, const D2: usize>(
tensor: <NdArray<E, Q> as Backend>::IntTensorPrimitive<D1>,
shape: Shape<D2>,
) -> <NdArray<E, Q> as Backend>::IntTensorPrimitive<D2>
fn int_expand<const D1: usize, const D2: usize>( tensor: <NdArray<E, Q> as Backend>::IntTensorPrimitive<D1>, shape: Shape<D2>, ) -> <NdArray<E, Q> as Backend>::IntTensorPrimitive<D2>
Broadcasts the int
tensor
to the given shape
.§fn int_repeat_dim<const D: usize>(
tensor: <B as Backend>::IntTensorPrimitive<D>,
dim: usize,
times: usize,
) -> <B as Backend>::IntTensorPrimitive<D>
fn int_repeat_dim<const D: usize>( tensor: <B as Backend>::IntTensorPrimitive<D>, dim: usize, times: usize, ) -> <B as Backend>::IntTensorPrimitive<D>
Repeats the tensor along the given dimension the given number of times. Read more
§fn int_not_equal<const D: usize>(
lhs: <B as Backend>::IntTensorPrimitive<D>,
rhs: <B as Backend>::IntTensorPrimitive<D>,
) -> <B as Backend>::BoolTensorPrimitive<D>
fn int_not_equal<const D: usize>( lhs: <B as Backend>::IntTensorPrimitive<D>, rhs: <B as Backend>::IntTensorPrimitive<D>, ) -> <B as Backend>::BoolTensorPrimitive<D>
Element-wise non-equality comparison. Read more
§fn int_not_equal_elem<const D: usize>(
lhs: <B as Backend>::IntTensorPrimitive<D>,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::BoolTensorPrimitive<D>
fn int_not_equal_elem<const D: usize>( lhs: <B as Backend>::IntTensorPrimitive<D>, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::BoolTensorPrimitive<D>
Element-wise non-equality comparison with a scalar. Read more
§fn int_powi_scalar<const D: usize>(
lhs: <B as Backend>::IntTensorPrimitive<D>,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive<D>
fn int_powi_scalar<const D: usize>( lhs: <B as Backend>::IntTensorPrimitive<D>, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::IntTensorPrimitive<D>
Element-wise power with a scalar. Read more
§fn int_max<const D: usize>(
tensor: <B as Backend>::IntTensorPrimitive<D>,
) -> <B as Backend>::IntTensorPrimitive<1>
fn int_max<const D: usize>( tensor: <B as Backend>::IntTensorPrimitive<D>, ) -> <B as Backend>::IntTensorPrimitive<1>
Gets the maximum element in the tensor. Read more
§fn int_max_dim<const D: usize>(
tensor: <B as Backend>::IntTensorPrimitive<D>,
dim: usize,
) -> <B as Backend>::IntTensorPrimitive<D>
fn int_max_dim<const D: usize>( tensor: <B as Backend>::IntTensorPrimitive<D>, dim: usize, ) -> <B as Backend>::IntTensorPrimitive<D>
Gets the maximum element in the tensor along a dimension. Read more
§fn int_max_dim_with_indices<const D: usize>(
tensor: <B as Backend>::IntTensorPrimitive<D>,
dim: usize,
) -> (<B as Backend>::IntTensorPrimitive<D>, <B as Backend>::IntTensorPrimitive<D>)
fn int_max_dim_with_indices<const D: usize>( tensor: <B as Backend>::IntTensorPrimitive<D>, dim: usize, ) -> (<B as Backend>::IntTensorPrimitive<D>, <B as Backend>::IntTensorPrimitive<D>)
Gets the maximum elements and corresponding indices along a dimension. Read more
§fn int_min<const D: usize>(
tensor: <B as Backend>::IntTensorPrimitive<D>,
) -> <B as Backend>::IntTensorPrimitive<1>
fn int_min<const D: usize>( tensor: <B as Backend>::IntTensorPrimitive<D>, ) -> <B as Backend>::IntTensorPrimitive<1>
Gets the minimum element in the tensor. Read more
§fn int_min_dim<const D: usize>(
tensor: <B as Backend>::IntTensorPrimitive<D>,
dim: usize,
) -> <B as Backend>::IntTensorPrimitive<D>
fn int_min_dim<const D: usize>( tensor: <B as Backend>::IntTensorPrimitive<D>, dim: usize, ) -> <B as Backend>::IntTensorPrimitive<D>
Gets the minimum elements in the tensor along a dimension. Read more
§fn int_min_dim_with_indices<const D: usize>(
tensor: <B as Backend>::IntTensorPrimitive<D>,
dim: usize,
) -> (<B as Backend>::IntTensorPrimitive<D>, <B as Backend>::IntTensorPrimitive<D>)
fn int_min_dim_with_indices<const D: usize>( tensor: <B as Backend>::IntTensorPrimitive<D>, dim: usize, ) -> (<B as Backend>::IntTensorPrimitive<D>, <B as Backend>::IntTensorPrimitive<D>)
Gets the minimum elements and corresponding indices along a dimension. Read more
§fn int_transpose<const D: usize>(
tensor: <B as Backend>::IntTensorPrimitive<D>,
) -> <B as Backend>::IntTensorPrimitive<D>
fn int_transpose<const D: usize>( tensor: <B as Backend>::IntTensorPrimitive<D>, ) -> <B as Backend>::IntTensorPrimitive<D>
Transposes an int tensor. Read more
§fn int_narrow<const D: usize>(
tensor: <B as Backend>::IntTensorPrimitive<D>,
dim: usize,
start: usize,
length: usize,
) -> <B as Backend>::IntTensorPrimitive<D>
fn int_narrow<const D: usize>( tensor: <B as Backend>::IntTensorPrimitive<D>, dim: usize, start: usize, length: usize, ) -> <B as Backend>::IntTensorPrimitive<D>
Returns a new tensor with the given dimension narrowed to the given range. Read more
§fn int_cartesian_grid<S, const D: usize, const D2: usize>(
shape: S,
device: &<B as Backend>::Device,
) -> <B as Backend>::IntTensorPrimitive<D2>
fn int_cartesian_grid<S, const D: usize, const D2: usize>( shape: S, device: &<B as Backend>::Device, ) -> <B as Backend>::IntTensorPrimitive<D2>
Generates a cartesian grid for the given tensor shape on the specified device.
The generated tensor is of dimension
D2 = D + 1
, where each element at dimension D contains the cartesian grid coordinates for that element. Read more§fn int_chunk<const D: usize>(
tensor: <B as Backend>::IntTensorPrimitive<D>,
chunks: usize,
dim: usize,
) -> Vec<<B as Backend>::IntTensorPrimitive<D>>
fn int_chunk<const D: usize>( tensor: <B as Backend>::IntTensorPrimitive<D>, chunks: usize, dim: usize, ) -> Vec<<B as Backend>::IntTensorPrimitive<D>>
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<1>
fn int_arange_step( range: Range<i64>, step: usize, device: &<B as Backend>::Device, ) -> <B as Backend>::IntTensorPrimitive<1>
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<1>
fn int_arange( range: Range<i64>, device: &<B as Backend>::Device, ) -> <B as Backend>::IntTensorPrimitive<1>
Creates a new tensor with values from the given range. Read more
§fn int_any<const D: usize>(
tensor: <B as Backend>::IntTensorPrimitive<D>,
) -> <B as Backend>::BoolTensorPrimitive<1>
fn int_any<const D: usize>( tensor: <B as Backend>::IntTensorPrimitive<D>, ) -> <B as Backend>::BoolTensorPrimitive<1>
Tests if any element in the int
tensor
evaluates to True. Read more§fn int_any_dim<const D: usize>(
tensor: <B as Backend>::IntTensorPrimitive<D>,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive<D>
fn int_any_dim<const D: usize>( tensor: <B as Backend>::IntTensorPrimitive<D>, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive<D>
§fn int_all<const D: usize>(
tensor: <B as Backend>::IntTensorPrimitive<D>,
) -> <B as Backend>::BoolTensorPrimitive<1>
fn int_all<const D: usize>( tensor: <B as Backend>::IntTensorPrimitive<D>, ) -> <B as Backend>::BoolTensorPrimitive<1>
Tests if all elements in the int
tensor
evaluate to True. Read more§fn int_all_dim<const D: usize>(
tensor: <B as Backend>::IntTensorPrimitive<D>,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive<D>
fn int_all_dim<const D: usize>( tensor: <B as Backend>::IntTensorPrimitive<D>, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive<D>
§fn int_sort<const D: usize>(
tensor: <B as Backend>::IntTensorPrimitive<D>,
dim: usize,
descending: bool,
) -> <B as Backend>::IntTensorPrimitive<D>
fn int_sort<const D: usize>( tensor: <B as Backend>::IntTensorPrimitive<D>, dim: usize, descending: bool, ) -> <B as Backend>::IntTensorPrimitive<D>
Sort the elements of the input
tensor
by value along a given dimension. Read more§fn int_sort_with_indices<const D: usize>(
tensor: <B as Backend>::IntTensorPrimitive<D>,
dim: usize,
descending: bool,
) -> (<B as Backend>::IntTensorPrimitive<D>, <B as Backend>::IntTensorPrimitive<D>)
fn int_sort_with_indices<const D: usize>( tensor: <B as Backend>::IntTensorPrimitive<D>, dim: usize, descending: bool, ) -> (<B as Backend>::IntTensorPrimitive<D>, <B as Backend>::IntTensorPrimitive<D>)
Sort the elements of the input
tensor
by value along a given dimension. Read more§fn int_argsort<const D: usize>(
tensor: <B as Backend>::IntTensorPrimitive<D>,
dim: usize,
descending: bool,
) -> <B as Backend>::IntTensorPrimitive<D>
fn int_argsort<const D: usize>( tensor: <B as Backend>::IntTensorPrimitive<D>, dim: usize, descending: bool, ) -> <B as Backend>::IntTensorPrimitive<D>
Returns the indices that sort the elements of the input
tensor
by value
along a given dimension. Read more§impl<E, Q> ModuleOps<NdArray<E, Q>> for NdArray<E, Q>where
E: FloatNdArrayElement,
Q: QuantElement,
impl<E, Q> ModuleOps<NdArray<E, Q>> for NdArray<E, Q>where
E: FloatNdArrayElement,
Q: QuantElement,
§fn conv2d(
x: NdArrayTensor<E, 4>,
weight: NdArrayTensor<E, 4>,
bias: Option<NdArrayTensor<E, 1>>,
options: ConvOptions<2>,
) -> NdArrayTensor<E, 4>
fn conv2d( x: NdArrayTensor<E, 4>, weight: NdArrayTensor<E, 4>, bias: Option<NdArrayTensor<E, 1>>, options: ConvOptions<2>, ) -> NdArrayTensor<E, 4>
Two dimensional convolution. Read more
§fn conv_transpose2d(
x: NdArrayTensor<E, 4>,
weight: NdArrayTensor<E, 4>,
bias: Option<NdArrayTensor<E, 1>>,
options: ConvTransposeOptions<2>,
) -> NdArrayTensor<E, 4>
fn conv_transpose2d( x: NdArrayTensor<E, 4>, weight: NdArrayTensor<E, 4>, bias: Option<NdArrayTensor<E, 1>>, options: ConvTransposeOptions<2>, ) -> NdArrayTensor<E, 4>
Two dimensional transposed convolution. Read more
§fn avg_pool2d(
x: NdArrayTensor<E, 4>,
kernel_size: [usize; 2],
stride: [usize; 2],
padding: [usize; 2],
count_include_pad: bool,
) -> NdArrayTensor<E, 4>
fn avg_pool2d( x: NdArrayTensor<E, 4>, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], count_include_pad: bool, ) -> NdArrayTensor<E, 4>
Two dimensional avg pooling. Read more
§fn avg_pool2d_backward(
x: NdArrayTensor<E, 4>,
grad: NdArrayTensor<E, 4>,
kernel_size: [usize; 2],
stride: [usize; 2],
padding: [usize; 2],
count_include_pad: bool,
) -> NdArrayTensor<E, 4>
fn avg_pool2d_backward( x: NdArrayTensor<E, 4>, grad: NdArrayTensor<E, 4>, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], count_include_pad: bool, ) -> NdArrayTensor<E, 4>
Backward pass for the avg pooling 2d operation.
§fn max_pool2d(
x: NdArrayTensor<E, 4>,
kernel_size: [usize; 2],
stride: [usize; 2],
padding: [usize; 2],
dilation: [usize; 2],
) -> NdArrayTensor<E, 4>
fn max_pool2d( x: NdArrayTensor<E, 4>, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], ) -> NdArrayTensor<E, 4>
Two dimensional max pooling. Read more
§fn max_pool2d_with_indices(
x: NdArrayTensor<E, 4>,
kernel_size: [usize; 2],
stride: [usize; 2],
padding: [usize; 2],
dilation: [usize; 2],
) -> MaxPool2dWithIndices<NdArray<E, Q>>
fn max_pool2d_with_indices( x: NdArrayTensor<E, 4>, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], ) -> MaxPool2dWithIndices<NdArray<E, Q>>
Two dimensional max pooling with indices. Read more
§fn max_pool2d_with_indices_backward(
x: NdArrayTensor<E, 4>,
kernel_size: [usize; 2],
stride: [usize; 2],
padding: [usize; 2],
dilation: [usize; 2],
output_grad: NdArrayTensor<E, 4>,
indices: NdArrayTensor<i64, 4>,
) -> MaxPool2dBackward<NdArray<E, Q>>
fn max_pool2d_with_indices_backward( x: NdArrayTensor<E, 4>, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], output_grad: NdArrayTensor<E, 4>, indices: NdArrayTensor<i64, 4>, ) -> MaxPool2dBackward<NdArray<E, Q>>
Backward pass for the max pooling 2d operation.
§fn adaptive_avg_pool2d(
x: NdArrayTensor<E, 4>,
output_size: [usize; 2],
) -> NdArrayTensor<E, 4>
fn adaptive_avg_pool2d( x: NdArrayTensor<E, 4>, output_size: [usize; 2], ) -> NdArrayTensor<E, 4>
Two dimensional adaptive avg pooling. Read more
§fn adaptive_avg_pool2d_backward(
x: NdArrayTensor<E, 4>,
grad: NdArrayTensor<E, 4>,
) -> NdArrayTensor<E, 4>
fn adaptive_avg_pool2d_backward( x: NdArrayTensor<E, 4>, grad: NdArrayTensor<E, 4>, ) -> NdArrayTensor<E, 4>
Backward pass for the adaptive avg pooling 2d operation.
§fn interpolate(
x: NdArrayTensor<E, 4>,
output_size: [usize; 2],
options: InterpolateOptions,
) -> NdArrayTensor<E, 4>
fn interpolate( x: NdArrayTensor<E, 4>, output_size: [usize; 2], options: InterpolateOptions, ) -> NdArrayTensor<E, 4>
Down/up samples the input. Read more
§fn interpolate_backward(
x: NdArrayTensor<E, 4>,
grad: NdArrayTensor<E, 4>,
output_size: [usize; 2],
options: InterpolateOptions,
) -> NdArrayTensor<E, 4>
fn interpolate_backward( x: NdArrayTensor<E, 4>, grad: NdArrayTensor<E, 4>, output_size: [usize; 2], options: InterpolateOptions, ) -> NdArrayTensor<E, 4>
Backward pass for the interpolate operation.
§fn conv3d(
x: NdArrayTensor<E, 5>,
weight: NdArrayTensor<E, 5>,
bias: Option<NdArrayTensor<E, 1>>,
options: ConvOptions<3>,
) -> NdArrayTensor<E, 5>
fn conv3d( x: NdArrayTensor<E, 5>, weight: NdArrayTensor<E, 5>, bias: Option<NdArrayTensor<E, 1>>, options: ConvOptions<3>, ) -> NdArrayTensor<E, 5>
Three dimensional convolution. Read more
§fn conv_transpose3d(
x: NdArrayTensor<E, 5>,
weight: NdArrayTensor<E, 5>,
bias: Option<NdArrayTensor<E, 1>>,
options: ConvTransposeOptions<3>,
) -> NdArrayTensor<E, 5>
fn conv_transpose3d( x: NdArrayTensor<E, 5>, weight: NdArrayTensor<E, 5>, bias: Option<NdArrayTensor<E, 1>>, options: ConvTransposeOptions<3>, ) -> NdArrayTensor<E, 5>
Three dimensional transposed convolution. Read more
§fn embedding(
weights: <B as Backend>::FloatTensorPrimitive<2>,
indices: <B as Backend>::IntTensorPrimitive<2>,
) -> <B as Backend>::FloatTensorPrimitive<3>
fn embedding( weights: <B as Backend>::FloatTensorPrimitive<2>, indices: <B as Backend>::IntTensorPrimitive<2>, ) -> <B as Backend>::FloatTensorPrimitive<3>
Embedding operation. Read more
§fn embedding_backward(
weights: <B as Backend>::FloatTensorPrimitive<2>,
output_grad: <B as Backend>::FloatTensorPrimitive<3>,
indices: <B as Backend>::IntTensorPrimitive<2>,
) -> <B as Backend>::FloatTensorPrimitive<2>
fn embedding_backward( weights: <B as Backend>::FloatTensorPrimitive<2>, output_grad: <B as Backend>::FloatTensorPrimitive<3>, indices: <B as Backend>::IntTensorPrimitive<2>, ) -> <B as Backend>::FloatTensorPrimitive<2>
Embedding backward operation. Read more
§fn conv1d(
x: <B as Backend>::FloatTensorPrimitive<3>,
weight: <B as Backend>::FloatTensorPrimitive<3>,
bias: Option<<B as Backend>::FloatTensorPrimitive<1>>,
options: ConvOptions<1>,
) -> <B as Backend>::FloatTensorPrimitive<3>
fn conv1d( x: <B as Backend>::FloatTensorPrimitive<3>, weight: <B as Backend>::FloatTensorPrimitive<3>, bias: Option<<B as Backend>::FloatTensorPrimitive<1>>, options: ConvOptions<1>, ) -> <B as Backend>::FloatTensorPrimitive<3>
One dimensional convolution. Read more
§fn conv1d_backward(
x: <B as Backend>::FloatTensorPrimitive<3>,
weight: <B as Backend>::FloatTensorPrimitive<3>,
bias: Option<<B as Backend>::FloatTensorPrimitive<1>>,
output_grad: <B as Backend>::FloatTensorPrimitive<3>,
options: ConvOptions<1>,
) -> Conv1dBackward<B>
fn conv1d_backward( x: <B as Backend>::FloatTensorPrimitive<3>, weight: <B as Backend>::FloatTensorPrimitive<3>, bias: Option<<B as Backend>::FloatTensorPrimitive<1>>, output_grad: <B as Backend>::FloatTensorPrimitive<3>, options: ConvOptions<1>, ) -> Conv1dBackward<B>
Backward pass for the conv1d operation.
§fn conv2d_backward(
x: <B as Backend>::FloatTensorPrimitive<4>,
weight: <B as Backend>::FloatTensorPrimitive<4>,
bias: Option<<B as Backend>::FloatTensorPrimitive<1>>,
output_grad: <B as Backend>::FloatTensorPrimitive<4>,
options: ConvOptions<2>,
) -> Conv2dBackward<B>
fn conv2d_backward( x: <B as Backend>::FloatTensorPrimitive<4>, weight: <B as Backend>::FloatTensorPrimitive<4>, bias: Option<<B as Backend>::FloatTensorPrimitive<1>>, output_grad: <B as Backend>::FloatTensorPrimitive<4>, options: ConvOptions<2>, ) -> Conv2dBackward<B>
Backward pass for the conv2d operation.
§fn conv3d_backward(
x: <B as Backend>::FloatTensorPrimitive<5>,
weight: <B as Backend>::FloatTensorPrimitive<5>,
bias: Option<<B as Backend>::FloatTensorPrimitive<1>>,
output_grad: <B as Backend>::FloatTensorPrimitive<5>,
options: ConvOptions<3>,
) -> Conv3dBackward<B>
fn conv3d_backward( x: <B as Backend>::FloatTensorPrimitive<5>, weight: <B as Backend>::FloatTensorPrimitive<5>, bias: Option<<B as Backend>::FloatTensorPrimitive<1>>, output_grad: <B as Backend>::FloatTensorPrimitive<5>, options: ConvOptions<3>, ) -> Conv3dBackward<B>
Backward pass for the conv3d operation.
§fn conv_transpose1d(
x: <B as Backend>::FloatTensorPrimitive<3>,
weight: <B as Backend>::FloatTensorPrimitive<3>,
bias: Option<<B as Backend>::FloatTensorPrimitive<1>>,
options: ConvTransposeOptions<1>,
) -> <B as Backend>::FloatTensorPrimitive<3>
fn conv_transpose1d( x: <B as Backend>::FloatTensorPrimitive<3>, weight: <B as Backend>::FloatTensorPrimitive<3>, bias: Option<<B as Backend>::FloatTensorPrimitive<1>>, options: ConvTransposeOptions<1>, ) -> <B as Backend>::FloatTensorPrimitive<3>
One dimensional transposed convolution. Read more
§fn conv_transpose1d_backward(
x: <B as Backend>::FloatTensorPrimitive<3>,
weight: <B as Backend>::FloatTensorPrimitive<3>,
bias: Option<<B as Backend>::FloatTensorPrimitive<1>>,
output_grad: <B as Backend>::FloatTensorPrimitive<3>,
options: ConvTransposeOptions<1>,
) -> Conv1dBackward<B>
fn conv_transpose1d_backward( x: <B as Backend>::FloatTensorPrimitive<3>, weight: <B as Backend>::FloatTensorPrimitive<3>, bias: Option<<B as Backend>::FloatTensorPrimitive<1>>, output_grad: <B as Backend>::FloatTensorPrimitive<3>, options: ConvTransposeOptions<1>, ) -> Conv1dBackward<B>
Backward pass for the conv transpose 1d operation.
§fn conv_transpose2d_backward(
x: <B as Backend>::FloatTensorPrimitive<4>,
weight: <B as Backend>::FloatTensorPrimitive<4>,
bias: Option<<B as Backend>::FloatTensorPrimitive<1>>,
output_grad: <B as Backend>::FloatTensorPrimitive<4>,
options: ConvTransposeOptions<2>,
) -> Conv2dBackward<B>
fn conv_transpose2d_backward( x: <B as Backend>::FloatTensorPrimitive<4>, weight: <B as Backend>::FloatTensorPrimitive<4>, bias: Option<<B as Backend>::FloatTensorPrimitive<1>>, output_grad: <B as Backend>::FloatTensorPrimitive<4>, options: ConvTransposeOptions<2>, ) -> Conv2dBackward<B>
Backward pass for the conv transpose 2d operation.
§fn conv_transpose3d_backward(
x: <B as Backend>::FloatTensorPrimitive<5>,
weight: <B as Backend>::FloatTensorPrimitive<5>,
bias: Option<<B as Backend>::FloatTensorPrimitive<1>>,
output_grad: <B as Backend>::FloatTensorPrimitive<5>,
options: ConvTransposeOptions<3>,
) -> Conv3dBackward<B>
fn conv_transpose3d_backward( x: <B as Backend>::FloatTensorPrimitive<5>, weight: <B as Backend>::FloatTensorPrimitive<5>, bias: Option<<B as Backend>::FloatTensorPrimitive<1>>, output_grad: <B as Backend>::FloatTensorPrimitive<5>, options: ConvTransposeOptions<3>, ) -> Conv3dBackward<B>
Backward pass for the conv transpose 3d operation.
§fn unfold4d(
x: <B as Backend>::FloatTensorPrimitive<4>,
kernel_size: [usize; 2],
options: UnfoldOptions,
) -> <B as Backend>::FloatTensorPrimitive<3>
fn unfold4d( x: <B as Backend>::FloatTensorPrimitive<4>, kernel_size: [usize; 2], options: UnfoldOptions, ) -> <B as Backend>::FloatTensorPrimitive<3>
Four-dimensional unfolding. Read more
§fn avg_pool1d(
x: <B as Backend>::FloatTensorPrimitive<3>,
kernel_size: usize,
stride: usize,
padding: usize,
count_include_pad: bool,
) -> <B as Backend>::FloatTensorPrimitive<3>
fn avg_pool1d( x: <B as Backend>::FloatTensorPrimitive<3>, kernel_size: usize, stride: usize, padding: usize, count_include_pad: bool, ) -> <B as Backend>::FloatTensorPrimitive<3>
One dimensional avg pooling. Read more
§fn avg_pool1d_backward(
x: <B as Backend>::FloatTensorPrimitive<3>,
grad: <B as Backend>::FloatTensorPrimitive<3>,
kernel_size: usize,
stride: usize,
padding: usize,
count_include_pad: bool,
) -> <B as Backend>::FloatTensorPrimitive<3>
fn avg_pool1d_backward( x: <B as Backend>::FloatTensorPrimitive<3>, grad: <B as Backend>::FloatTensorPrimitive<3>, kernel_size: usize, stride: usize, padding: usize, count_include_pad: bool, ) -> <B as Backend>::FloatTensorPrimitive<3>
Backward pass for the avg pooling 1d operation.
§fn adaptive_avg_pool1d(
x: <B as Backend>::FloatTensorPrimitive<3>,
output_size: usize,
) -> <B as Backend>::FloatTensorPrimitive<3>
fn adaptive_avg_pool1d( x: <B as Backend>::FloatTensorPrimitive<3>, output_size: usize, ) -> <B as Backend>::FloatTensorPrimitive<3>
One dimensional adaptive avg pooling. Read more
§fn adaptive_avg_pool1d_backward(
x: <B as Backend>::FloatTensorPrimitive<3>,
grad: <B as Backend>::FloatTensorPrimitive<3>,
) -> <B as Backend>::FloatTensorPrimitive<3>
fn adaptive_avg_pool1d_backward( x: <B as Backend>::FloatTensorPrimitive<3>, grad: <B as Backend>::FloatTensorPrimitive<3>, ) -> <B as Backend>::FloatTensorPrimitive<3>
Backward pass for the adaptive avg pooling 1d operation.
§fn max_pool1d(
x: <B as Backend>::FloatTensorPrimitive<3>,
kernel_size: usize,
stride: usize,
padding: usize,
dilation: usize,
) -> <B as Backend>::FloatTensorPrimitive<3>
fn max_pool1d( x: <B as Backend>::FloatTensorPrimitive<3>, kernel_size: usize, stride: usize, padding: usize, dilation: usize, ) -> <B as Backend>::FloatTensorPrimitive<3>
One dimensional max pooling. Read more
§fn max_pool1d_with_indices(
x: <B as Backend>::FloatTensorPrimitive<3>,
kernel_size: usize,
stride: usize,
padding: usize,
dilation: usize,
) -> MaxPool1dWithIndices<B>
fn max_pool1d_with_indices( x: <B as Backend>::FloatTensorPrimitive<3>, 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<3>,
kernel_size: usize,
stride: usize,
padding: usize,
dilation: usize,
output_grad: <B as Backend>::FloatTensorPrimitive<3>,
indices: <B as Backend>::IntTensorPrimitive<3>,
) -> MaxPool1dBackward<B>
fn max_pool1d_with_indices_backward( x: <B as Backend>::FloatTensorPrimitive<3>, kernel_size: usize, stride: usize, padding: usize, dilation: usize, output_grad: <B as Backend>::FloatTensorPrimitive<3>, indices: <B as Backend>::IntTensorPrimitive<3>, ) -> MaxPool1dBackward<B>
Backward pass for the max pooling 1d operation.
§impl<E, Q> QTensorOps<NdArray<E, Q>> for NdArray<E, Q>where
E: FloatNdArrayElement,
Q: QuantElement,
impl<E, Q> QTensorOps<NdArray<E, Q>> for NdArray<E, Q>where
E: FloatNdArrayElement,
Q: QuantElement,
§fn q_from_data<const D: usize>(
data: TensorData,
_device: &NdArrayDevice,
) -> <NdArray<E, Q> as Backend>::QuantizedTensorPrimitive<D>
fn q_from_data<const D: usize>( data: TensorData, _device: &NdArrayDevice, ) -> <NdArray<E, Q> as Backend>::QuantizedTensorPrimitive<D>
Creates a new tensor from the data structure. Read more
§fn quantize<const D: usize>(
tensor: <NdArray<E, Q> as Backend>::FloatTensorPrimitive<D>,
scheme: &QuantizationScheme,
qparams: QuantizationParametersPrimitive<NdArray<E, Q>>,
) -> <NdArray<E, Q> as Backend>::QuantizedTensorPrimitive<D>
fn quantize<const D: usize>( tensor: <NdArray<E, Q> as Backend>::FloatTensorPrimitive<D>, scheme: &QuantizationScheme, qparams: QuantizationParametersPrimitive<NdArray<E, Q>>, ) -> <NdArray<E, Q> as Backend>::QuantizedTensorPrimitive<D>
Convert the tensor to a lower precision data type based on the quantization scheme and parameters.
§fn dequantize<const D: usize>(
tensor: <NdArray<E, Q> as Backend>::QuantizedTensorPrimitive<D>,
) -> <NdArray<E, Q> as Backend>::FloatTensorPrimitive<D>
fn dequantize<const D: usize>( tensor: <NdArray<E, Q> as Backend>::QuantizedTensorPrimitive<D>, ) -> <NdArray<E, Q> as Backend>::FloatTensorPrimitive<D>
Convert the tensor back to a higher precision data type.
§fn q_shape<const D: usize>(
tensor: &<NdArray<E, Q> as Backend>::QuantizedTensorPrimitive<D>,
) -> Shape<D>
fn q_shape<const D: usize>( tensor: &<NdArray<E, Q> as Backend>::QuantizedTensorPrimitive<D>, ) -> Shape<D>
Gets the shape of the tensor. Read more
§fn q_device<const D: usize>(
_tensor: &<NdArray<E, Q> as Backend>::QuantizedTensorPrimitive<D>,
) -> NdArrayDevice
fn q_device<const D: usize>( _tensor: &<NdArray<E, Q> as Backend>::QuantizedTensorPrimitive<D>, ) -> NdArrayDevice
Gets the device of the tensor. Read more
§fn q_reshape<const D1: usize, const D2: usize>(
tensor: <NdArray<E, Q> as Backend>::QuantizedTensorPrimitive<D1>,
shape: Shape<D2>,
) -> <NdArray<E, Q> as Backend>::QuantizedTensorPrimitive<D2>
fn q_reshape<const D1: usize, const D2: usize>( tensor: <NdArray<E, Q> as Backend>::QuantizedTensorPrimitive<D1>, shape: Shape<D2>, ) -> <NdArray<E, Q> as Backend>::QuantizedTensorPrimitive<D2>
Reshapes a tensor. Read more
§async fn q_into_data<const D: usize>(
tensor: <NdArray<E, Q> as Backend>::QuantizedTensorPrimitive<D>,
) -> TensorData
async fn q_into_data<const D: usize>( tensor: <NdArray<E, Q> as Backend>::QuantizedTensorPrimitive<D>, ) -> TensorData
Converts the tensor to a data structure. Read more
§fn q_set_require_grad<const D: usize>(
tensor: <B as Backend>::QuantizedTensorPrimitive<D>,
_require_grad: bool,
) -> <B as Backend>::QuantizedTensorPrimitive<D>
fn q_set_require_grad<const D: usize>( tensor: <B as Backend>::QuantizedTensorPrimitive<D>, _require_grad: bool, ) -> <B as Backend>::QuantizedTensorPrimitive<D>
Sets the
require_grad
flag of a tensor.§fn q_is_require_grad<const D: usize>(
_tensor: &<B as Backend>::QuantizedTensorPrimitive<D>,
) -> bool
fn q_is_require_grad<const D: usize>( _tensor: &<B as Backend>::QuantizedTensorPrimitive<D>, ) -> bool
Returns the
require_grad
flag of a tensor.impl<E, Q> Copy for NdArray<E, Q>
Auto Trait Implementations§
impl<E, Q> Freeze for NdArray<E, Q>
impl<E, Q> RefUnwindSafe for NdArray<E, Q>where
E: RefUnwindSafe,
Q: RefUnwindSafe,
impl<E, Q> Send for NdArray<E, Q>
impl<E, Q> Sync for NdArray<E, Q>
impl<E, Q> Unpin for NdArray<E, Q>
impl<E, Q> UnwindSafe for NdArray<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: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
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
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default 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()
.