pub struct Tensor<T> { /* private fields */ }Expand description
The N Dimensional Array
Implementations§
Source§impl<T: Copy> Tensor<T>
impl<T: Copy> Tensor<T>
Sourcepub fn cat(&self, other: &Tensor<T>, dim: usize) -> Result<Tensor<T>, Errors>
pub fn cat(&self, other: &Tensor<T>, dim: usize) -> Result<Tensor<T>, Errors>
Returns a Tensor which is the concatenation of self and other along dimension dim
The 2 tensors must have equal number of dimensions and the dimensions can differ only at concatenation dimension
§Arguments
- other - The other tensor to concatenate with self
- dim - The dimension index to concatenate on
§Examples
let t1 =
Tensor::from_slice_and_dims(&[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], &[3, 4]).unwrap();
let t2 = Tensor::from_slice_and_dims(&[13, 14, 15, 16, 17, 18], &[3, 2]).unwrap();
let res = t1.cat(&t2, 1).unwrap();
// res = [[1, 2, 3, 4, 13, 14], [5, 6, 7, 8, 15, 16], [9, 10, 11, 12, 17, 18]]Sourcepub fn concatenate(
&self,
other: &Tensor<T>,
dim: usize,
) -> Result<Tensor<T>, Errors>
pub fn concatenate( &self, other: &Tensor<T>, dim: usize, ) -> Result<Tensor<T>, Errors>
Alias to cat
Sourcepub fn chunk(&self, cnt: usize, dim: usize) -> Result<Vec<Tensor<T>>, Errors>
pub fn chunk(&self, cnt: usize, dim: usize) -> Result<Vec<Tensor<T>>, Errors>
Split tensors into cnt number of pieces along dimension dim and return the collection
of tensors
§Arguments
- cnt - The number of chunks
- dim - The dimension to chunk on
§Examples
let t = Tensor::arange(0, 11, 1).unwrap();
let res = t.chunk(6, 0).unwrap();
// res: Vec<Tensor<i32>> = vec![[0, 1], [2, 3], [4, 5], [6, 7], [8, 9], [10]]Sourcepub fn gather(
&self,
dim: usize,
indices: &Tensor<usize>,
) -> Result<Tensor<T>, Errors>
pub fn gather( &self, dim: usize, indices: &Tensor<usize>, ) -> Result<Tensor<T>, Errors>
Return tensor with values according to the index in the corresponding element in
indices along dimension dim
§Arguments
- dim - The dimension to gather on
- indices - The indices tensor
§Examples
let t = Tensor::arange(1, 5, 1).unwrap().reshape(&[2, 2]).unwrap();
let ind = Tensor::from_slice_and_dims(&[0, 0, 1, 0], &[2, 2]).unwrap();
let gather = t.gather(1, ind);
// gather = [[1, 1], [4, 3]]Sourcepub fn masked_select(&self, pick: &Tensor<bool>) -> Result<Tensor<T>, Errors>
pub fn masked_select(&self, pick: &Tensor<bool>) -> Result<Tensor<T>, Errors>
Returns a 1D Tensor which picks elements from self if the corresponding element in
mask in true
The dimensions of the specified tensor must match the dimensions of self
§Arguments
- pick - The mask tensor
§Examples
let t = Tensor::from_slice_and_dims(
&[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
&[3, 5],
)
.unwrap();
let pick = Tensor::from_slice_and_dims(
&[
true, true, false, true, false, false, false, true, false, false, false, false,
false, false, false,
],
&[3, 5],
)
.unwrap();
let res = t.masked_select(&pick).unwrap();
// res = [1, 2, 4, 8]Sourcepub fn permute(&self, permutation: &[usize]) -> Result<Tensor<T>, Errors>
pub fn permute(&self, permutation: &[usize]) -> Result<Tensor<T>, Errors>
Returns a tensor with same data as self but with it’s dimension permuted by the
permutation permutation
§Arguments
- permutation - The permutation to permute the dimensions to. Must be a permutation from 0 to number of dimensions - 1
§Examples
let t = Tensor::arange(1, 11, 1).unwrap().reshape(&[5, 2]).unwrap();
let res = t.permute(&[1, 0]).unwrap();
// res = [[1, 3, 5, 7, 9], [2, 4, 6, 8, 10]]Source§impl<T: Copy> Tensor<T>
impl<T: Copy> Tensor<T>
Source§impl<T: Default + Copy> Tensor<T>
impl<T: Default + Copy> Tensor<T>
Source§impl<T: Copy + NumCast> Tensor<T>
impl<T: Copy + NumCast> Tensor<T>
Source§impl<T: Copy + Add<Output = T> + Mul<Output = T> + NumCast + PartialOrd> Tensor<T>
impl<T: Copy + Add<Output = T> + Mul<Output = T> + NumCast + PartialOrd> Tensor<T>
Sourcepub fn arange(st: T, en: T, step: T) -> Result<Tensor<T>, Errors>
pub fn arange(st: T, en: T, step: T) -> Result<Tensor<T>, Errors>
Return a 1D tensor where the i th element is st + i * step such that each element is in
the range from st to en (exclusive)
§Arguments
- st - The start of the range
- en - The end of the range
- step - The step size
§Examples
let t = Tensor::arange(1, 11, 1).unwrap();
// t = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]Source§impl<T: Copy + Float + Display> Tensor<T>
impl<T: Copy + Float + Display> Tensor<T>
Sourcepub fn linspace(st: T, en: T, cnt: usize) -> Result<Tensor<T>, Errors>
pub fn linspace(st: T, en: T, cnt: usize) -> Result<Tensor<T>, Errors>
Returns a 1D tensor with cnt elements equally spaced in the range from st to en
§Arguments
- st - Start of the range
- en - End of the range
- cnt - The number of elements in the resultant tensor
§Examples
let t = Tensor::linspace(0.0, 1.0, 11).unwrap();
// t = [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]Sourcepub fn logspace(base: T, st: T, en: T, cnt: usize) -> Result<Tensor<T>, Errors>
pub fn logspace(base: T, st: T, en: T, cnt: usize) -> Result<Tensor<T>, Errors>
Return a 1D Tensor of size cnt with elements evenly spaced from base^st to
base^en on a logarithmic scale with base base
§Arguments
- base - Base for the logarithmic scale
- st - Start of the range
- en - End of the range
§Examples
let t = Tensor::logspace(10.0, -10.0, 10.0, 5).unwrap();
// t = [1e-10, 1e-5, 1, 1e5, 1e10]Source§impl<T: Copy> Tensor<T>
impl<T: Copy> Tensor<T>
Sourcepub fn map<R: Copy, F: Fn(T) -> R>(&self, f: F) -> Tensor<R>
pub fn map<R: Copy, F: Fn(T) -> R>(&self, f: F) -> Tensor<R>
Apply any function to every element of self and create a new tensor with the results This is similar to rust’s .map() in iterators
§Arguments
- f - Function that takes type T and returns a new value R
§Examples
// t is some tensor
let some_complicated_function_values_as_tensor = t.map(|x| some_complicated_function(x));Sourcepub fn map_with<O: Copy, R: Copy, F: Fn(T, O) -> R>(
&self,
other: &Tensor<O>,
f: F,
) -> Tensor<R>
pub fn map_with<O: Copy, R: Copy, F: Fn(T, O) -> R>( &self, other: &Tensor<O>, f: F, ) -> Tensor<R>
elements) and create a new tensor with the results This is similar to rust’s .zip().map() in iterators
§Arguments
- other - The other tensor
- f - Function that takes type T and returns a new value R
§Examples
// t is some tensor
let dist_from_origin_tensor = x_coords.map_with(&y_coords, |(x, y)| (x * x + y * y).sqrt());Source§impl<T: Copy + Signed> Tensor<T>
impl<T: Copy + Signed> Tensor<T>
Source§impl<T: Copy + Float> Tensor<T>
impl<T: Copy + Float> Tensor<T>
Sourcepub fn asin(&self) -> Tensor<T>
pub fn asin(&self) -> Tensor<T>
Calculate the inverse sine function for every element of self and returns a new tensor of the results
§Examples
let asin_t = t.asin();Sourcepub fn acos(&self) -> Tensor<T>
pub fn acos(&self) -> Tensor<T>
Calculate the inverse cosine function for every element of self and returns a new tensor of the results
§Examples
let acos_t = t.acos();Sourcepub fn atan(&self) -> Tensor<T>
pub fn atan(&self) -> Tensor<T>
Calculate the inverse tangent function for every element of self and returns a new tensor of the results
§Examples
let atan_t = t.atan();Sourcepub fn asinh(&self) -> Tensor<T>
pub fn asinh(&self) -> Tensor<T>
Calculate the inverse hyperbolic sine function for every element of self and returns a new tensor of the results
§Examples
let asinh_t = t.asinh();Sourcepub fn acosh(&self) -> Tensor<T>
pub fn acosh(&self) -> Tensor<T>
Calculate the inverse hyperbolic cosine function for every element of self and returns a new tensor of the results
§Examples
let acosh_t = t.acosh();Sourcepub fn atanh(&self) -> Tensor<T>
pub fn atanh(&self) -> Tensor<T>
Calculate the inverse hyperbolic tangent function for every element of self and returns a new tensor of the results
§Examples
let atanh_t = t.atanh();Sourcepub fn arcsin(&self) -> Tensor<T>
pub fn arcsin(&self) -> Tensor<T>
Calculate the inverse sine function for every element of self and returns a new tensor of the results
§Examples
let arcsin_t = t.arcsin();Sourcepub fn arccos(&self) -> Tensor<T>
pub fn arccos(&self) -> Tensor<T>
Calculate the inverse cosine function for every element of self and returns a new tensor of the results
§Examples
let arccos_t = t.arccos();Sourcepub fn arctan(&self) -> Tensor<T>
pub fn arctan(&self) -> Tensor<T>
Calculate the inverse tangent function for every element of self and returns a new tensor of the results
§Examples
let arctan_t = t.arctan();Sourcepub fn arcsinh(&self) -> Tensor<T>
pub fn arcsinh(&self) -> Tensor<T>
Calculate the inverse hyperbolic sine function for every element of self and returns a new tensor of the results
§Examples
let arcsinh_t = t.arcsinh();Sourcepub fn arccosh(&self) -> Tensor<T>
pub fn arccosh(&self) -> Tensor<T>
Calculate the inverse hyperbolic cosine function for every element of self and returns a new tensor of the results
§Examples
let arccosh_t = t.arccosh();Sourcepub fn arctanh(&self) -> Tensor<T>
pub fn arctanh(&self) -> Tensor<T>
Calculate the inverse hyperbolic tangent function for every element of self and returns a new tensor of the results
§Examples
let arctanh_t = t.arctanh();Sourcepub fn ceil(&self) -> Tensor<T>
pub fn ceil(&self) -> Tensor<T>
Calculate the ceiling function for every element of self and returns a new tensor of the results
§Examples
let ceil_t = t.ceil();Sourcepub fn cos(&self) -> Tensor<T>
pub fn cos(&self) -> Tensor<T>
Calculate the cosine function for every element of self and returns a new tensor of the results
§Examples
let cos_t = t.cos();Sourcepub fn cosh(&self) -> Tensor<T>
pub fn cosh(&self) -> Tensor<T>
Calculate the hyperbolic cosine function for every element of self and returns a new tensor of the results
§Examples
let cosh_t = t.cosh();Sourcepub fn degrees_to_radians(&self) -> Tensor<T>
pub fn degrees_to_radians(&self) -> Tensor<T>
Convert Degrees to Radians for every element of self and returns a new tensor of the results
§Examples
let degrees_to_radians_t = t.degrees_to_radians();Sourcepub fn radians_to_degrees(&self) -> Tensor<T>
pub fn radians_to_degrees(&self) -> Tensor<T>
Convert radians to degrees for every element of self and returns a new tensor of the results
§Examples
let radians_to_degrees_t = t.radians_to_degrees();Sourcepub fn exp(&self) -> Tensor<T>
pub fn exp(&self) -> Tensor<T>
Calculate the exponential function for every element of self and returns a new tensor of the results
§Examples
let exp_t = t.exp();Sourcepub fn exp_2(&self) -> Tensor<T>
pub fn exp_2(&self) -> Tensor<T>
Calculate the exponential function with base 2 for every element of self and returns a new tensor of the results
§Examples
let exp_2_t = t.exp_2();Sourcepub fn trunc(&self) -> Tensor<T>
pub fn trunc(&self) -> Tensor<T>
Truncate every element of self and returns a new tensor of the results
§Examples
let trunc_t = t.trunc();Sourcepub fn log(&self) -> Tensor<T>
pub fn log(&self) -> Tensor<T>
Calculate the natura logarithm function for every element of self and returns a new tensor of the results
§Examples
let log_t = t.log();Sourcepub fn log_10(&self) -> Tensor<T>
pub fn log_10(&self) -> Tensor<T>
Calculate the logarithm function with base 10 for every element of self and returns a new tensor of the results
§Examples
let log_10_t = t.log_10();Sourcepub fn log_2(&self) -> Tensor<T>
pub fn log_2(&self) -> Tensor<T>
Calculate the logarithm function with base 2 for every element of self and returns a new tensor of the results
§Examples
let log_2_t = t.log_2();Sourcepub fn round(&self) -> Tensor<T>
pub fn round(&self) -> Tensor<T>
Round every element of self and returns a new tensor of the results
§Examples
let round_t = t.round();Sourcepub fn floor(&self) -> Tensor<T>
pub fn floor(&self) -> Tensor<T>
Calculate the floor function for every element of self and returns a new tensor of the results
§Examples
let floor_t = t.floor();Sourcepub fn frac(&self) -> Tensor<T>
pub fn frac(&self) -> Tensor<T>
Get fractional complement for every element of self and returns a new tensor of the results
§Examples
let frac_t = t.frac();Sourcepub fn sqrt(&self) -> Tensor<T>
pub fn sqrt(&self) -> Tensor<T>
Calculate the square root function for every element of self and returns a new tensor of the results
§Examples
let sqrt_t = t.sqrt();Sourcepub fn hypot(&self, other: &Tensor<T>) -> Tensor<T>
pub fn hypot(&self, other: &Tensor<T>) -> Tensor<T>
Finds length of hypotenuse of right triangle with sides lengths as elements in self and returns a new tensor of the results results
§Examples
let hypot_t = t.hypot();Sourcepub fn rsqrt(&self) -> Tensor<T>
pub fn rsqrt(&self) -> Tensor<T>
Calculate the reciprocal of the square root function for every element of self and returns a new tensor of the results
§Examples
let rsqrt_t = t.rsqrt();Sourcepub fn expit(&self) -> Tensor<T>
pub fn expit(&self) -> Tensor<T>
Here we calculate expit(x) for every element in self
The Expit Function, also known as the logistic function, or the sigmoid function is a S shaped curve that appears frequently in many branches of science.
Formally it is defined as: sigmoid(x) = 1 / (1 + e^(-x))
§Examples
// t is some tensor of floats
let expit_1 = t.expit();Sourcepub fn logit(&self) -> Tensor<T>
pub fn logit(&self) -> Tensor<T>
Here we calculate logit(x) for every element in self
The Logit function is the quantile function associated with the standard logistic distribution.
Formally it is defined as: logit(p) = ln(p / (1 - p))
§Examples
// t is some tensor of floats
let logit_1 = t.logit();Source§impl<T: Copy + Float + NumCast> Tensor<T>
impl<T: Copy + Float + NumCast> Tensor<T>
Sourcepub fn erf(&self) -> Tensor<T>
pub fn erf(&self) -> Tensor<T>
Here we calculate erf(x) for every element in self
The error function, denoted by erf, is encountered when integrating the normal distribution.
It is formally defined as a complex valued function: erf(z) = 2 / sqrt(pi) * integrate(e^-(t^2) dt) from 0 to z.
Here we approximate erf(z) for every element in self only for real z with maximum error
upto 1.5 * 10^(-7).
The approximation method can be found on the wikipedia article of the erf function. This approximation method is credited to Abramowitz and Stegun.
See the wikipedia article for more information
§Examples
// t is some tensor of floats
let t_erf = t.erf();Sourcepub fn erfc(&self) -> Tensor<T>
pub fn erfc(&self) -> Tensor<T>
Here we calculate erfc(x) for every element in self
The error function complement, denoted by erfc, is encountered when integrating the normal distribution.
It is formally defined as a complex valued function: erfc(z) = 1 - erf(z) = 1 - 2 / sqrt(pi) * integrate(e^-(t^2) dt) from 0 to z.
Here we approximate erfc(z) for every element in self only for real z with maximum error
upto 1.5 * 10^(-7).
The approximation method can be found on the wikipedia article of the erfc function. This approximation method is credited to Abramowitz and Stegun.
See the wikipedia article for more information
§Examples
// t is some tensor of floats
let t_erfc = t.erfc();Source§impl<T: Copy + Float + FloatConst> Tensor<T>
impl<T: Copy + Float + FloatConst> Tensor<T>
Sourcepub fn sinc(&self) -> Tensor<T>
pub fn sinc(&self) -> Tensor<T>
Here we calculate the normalized sinc function for every element in self
The normalized sinc function is defined as the Fourier transform of the rectangular function with no scaling.
It is formally defined as: sinc(x) = sin(pi * x) / (pi * x) where x != 0, and sinc(0) = 1
§Examples
// t is some tensor of floats
let t_sinc = t.sinc();Sourcepub fn log_gammaf(&self) -> Tensor<T>
pub fn log_gammaf(&self) -> Tensor<T>
Here we calculate log_gamma(x) for every element in self for real x
The log gamma function is defined as the natural log of the gamma function, which is the most used extension to the factorial function into the complex plane.
It is formally defined as a complex valued function: log_gamma(x) = ln(gamma(x)) = ln( integrate(t^(z - 1) * e^(-t) * dt) from 0 to +inf )
Here we approximate log_gamma(x) with accuracy > 10 d.p
The approximation is based on the implementation of SciPy. For small values (< 0.2), this returns the Taylor series expansion of log gamma around 0 with 23 terms. For slightly larger values, this returns the result using a recursive formula and the Taylor series expansion like before. For big values (> 7), this returns the famous stirling approximation for log gamma For values in between, this returns the result by repeatedly applying another recursive. formula, and finally using the stirling approximation. For negative values, this returns the result using a reflection formula.
See scipy’s implementation and Hare “Computing the Principal Branch of log-Gamma” on Journal of Algorithms 1997 for more details
§Examples
// t is some tensor of floats
let t_gamma = t.log_gammaf();Sourcepub fn gammaf(&self) -> Tensor<T>
pub fn gammaf(&self) -> Tensor<T>
Calculate Gamma Function (for reals)
The gamma function is the most used extension to the factorial function into the complex plane.
It is formally defined as a complex valued function: gamma(x) = integrate(t^(z - 1) * e^(-t) * dt) from 0 to +inf
Here we approximate gamma(x) with accuracy > 10 d.p
Under the hood, this exponentiates log_gamma(x) See Tensor::log_gamma for details of the approximation.
§Examples
// t is some tensor of floats
let t_gamma = t.gammaf();Source§impl<T: Copy + Float + FloatConst> Tensor<Complex<T>>
impl<T: Copy + Float + FloatConst> Tensor<Complex<T>>
Sourcepub fn log_gamma(&self) -> Tensor<Complex<T>>
pub fn log_gamma(&self) -> Tensor<Complex<T>>
Here we calculate log_gamma(x) for every element in self for complex x
The log gamma function is defined as the natural log of the gamma function, which is the most used extension to the factorial function into the complex plane.
It is formally defined as a complex valued function: log_gamma(x) = ln(gamma(x)) = ln( integrate(t^(z - 1) * e^(-t) * dt) from 0 to +inf )
Here we approximate log_gamma(x) with accuracy > 10 d.p
The approximation is based on the implementation of SciPy. For small values (< 0.2), this returns the Taylor series expansion of log gamma around 0 with 23 terms. For slightly larger values, this returns the result using a recursive formula and the Taylor series expansion like before. For big values (> 7), this returns the famous stirling approximation for log gamma For values in between, this returns the result by repeatedly applying another recursive. formula, and finally using the stirling approximation. For negative values, this returns the result using a reflection formula.
See scipy’s implementation and Hare “Computing the Principal Branch of log-Gamma” on Journal of Algorithms 1997 for more details
§Examples
// t is some tensor of floats
let t_gamma = t.log_gamma();Sourcepub fn gamma(&self) -> Tensor<Complex<T>>
pub fn gamma(&self) -> Tensor<Complex<T>>
Calculate Gamma Function (for complex) The gamma function is the most used extension to the factorial function into the complex plane. It is formally defined as a complex valued function: gamma(x) = integrate(t^(z - 1) * e^(-t) * dt) from 0 to +inf
Here we approximate gamma(x) with accuracy > 10 d.p
Under the hood, this exponentiates log_gamma(x)
See [log_gamma] for details of the approximation.
§Examples
// t is some tensor of floats
let t_gamma = t.gammaf();Source§impl<T: Copy> Tensor<T>
impl<T: Copy> Tensor<T>
Sourcepub fn element_add<O: Copy, R: Copy>(&self, other: &Tensor<O>) -> Tensor<R>where
T: Add<O, Output = R>,
pub fn element_add<O: Copy, R: Copy>(&self, other: &Tensor<O>) -> Tensor<R>where
T: Add<O, Output = R>,
Pairwise add elements from self and other and return tensor with results
§Examples
let a_plus_b = a.element_add(b);Sourcepub fn element_sub<O: Copy, R: Copy>(&self, other: &Tensor<O>) -> Tensor<R>where
T: Sub<O, Output = R>,
pub fn element_sub<O: Copy, R: Copy>(&self, other: &Tensor<O>) -> Tensor<R>where
T: Sub<O, Output = R>,
Pairwise subtract elements from self and other and return tensor with results
§Examples
let a_plus_b = a.element_add(b);Source§impl<T: Copy + PartialOrd + Display> Tensor<T>
impl<T: Copy + PartialOrd + Display> Tensor<T>
Source§impl<T: Copy + Neg<Output = T>> Tensor<T>
impl<T: Copy + Neg<Output = T>> Tensor<T>
Source§impl<T: Copy + Inv<Output = T>> Tensor<T>
impl<T: Copy + Inv<Output = T>> Tensor<T>
Sourcepub fn inv(&self) -> Tensor<T>
pub fn inv(&self) -> Tensor<T>
Calculate the reciprocal function for every element of self and returns a new tensor of the results
§Examples
let inv_t = t.inv();Sourcepub fn reciprocal(&self) -> Tensor<T>
pub fn reciprocal(&self) -> Tensor<T>
Calculate the reciprocal function for every element of self and returns a new tensor of the results
§Examples
let reciprocal_t = t.reciprocal();Source§impl<T: Copy> Tensor<T>
impl<T: Copy> Tensor<T>
Sourcepub fn new(
storage: Rc<RefCell<TensorStorage<T>>>,
offset: usize,
dims: &[usize],
strides: &[usize],
) -> Result<Tensor<T>, Errors>
pub fn new( storage: Rc<RefCell<TensorStorage<T>>>, offset: usize, dims: &[usize], strides: &[usize], ) -> Result<Tensor<T>, Errors>
Create new tensor with custom TensorStorage, offset, dimensions, and strides. Not recommended for use
Sourcepub fn new_unchecked(
storage: Rc<RefCell<TensorStorage<T>>>,
offset: usize,
dims: &[usize],
strides: &[usize],
) -> Tensor<T>
pub fn new_unchecked( storage: Rc<RefCell<TensorStorage<T>>>, offset: usize, dims: &[usize], strides: &[usize], ) -> Tensor<T>
Create new tensor with custom TensorStorage, offset, dimensions, and strides, without any checks Not recommended for use
Sourcepub fn get_storage_ptr(&self) -> Rc<RefCell<TensorStorage<T>>>
pub fn get_storage_ptr(&self) -> Rc<RefCell<TensorStorage<T>>>
Get pointer to self.storage
Sourcepub fn make_contiguous(&self) -> Tensor<T>
pub fn make_contiguous(&self) -> Tensor<T>
Make self own it’s own data
Sourcepub fn slice_unchecked(&self, rngs: &[Range<usize>]) -> Tensor<T>
pub fn slice_unchecked(&self, rngs: &[Range<usize>]) -> Tensor<T>
Index self with rngs without checks
Sourcepub fn at_unchecked(&self, index: &[usize]) -> T
pub fn at_unchecked(&self, index: &[usize]) -> T
Get value in self at index index without checks
Sourcepub fn upd(&self, index: &[usize], new_val: T) -> Result<(), Errors>
pub fn upd(&self, index: &[usize], new_val: T) -> Result<(), Errors>
Update value in self at index index to new_val
Sourcepub fn upd_unchecked(&self, index: &[usize], new_val: T)
pub fn upd_unchecked(&self, index: &[usize], new_val: T)
Update value in self at index index to new_val without checks