Struct tc_tensor::Bounds[][src]

pub struct Bounds { /* fields omitted */ }
Expand description

Tensor bounds

Implementations

The bounds of the entire Tensor with the given Shape

Return an iterator over all the Coords within these Bounds.

Return true if these bounds contain the given coordinate.

Return Some(Coord) if these bounds match a single Coord, otherwise None

Expand these Bounds to the entire given Shape.

Example:

let mut bounds = Bounds::from(&[0u64][..]);
assert_eq!(bounds.to_shape(&Shape::from(vec![2, 3, 4])).unwrap(), Shape::from(vec![3, 4]));

Return the Shape of the Tensor slice with these Bounds.

Return the size of the slice with these Bounds, assuming they are of the same length as the source shape.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Creates a value from an iterator. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Test if value can be cast into Self.

Returns Some(Self) if the source value can be cast into Self, otherwise None.

Returns Ok(Self) if the source value can be cast into Self, otherwise calls on_err.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Returns true if self can be cast into the target type T.

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

Converts the given value to a String. Read more

Test if value can be cast into Self.

Returns Some(Self) if the source value can be cast into Self, otherwise None.

Returns Ok(Self) if the source value can be cast into Self, otherwise calls on_err.

Test if self can be cast into T.

Returns Some(T) if self can be cast into T, otherwise None.

Returns Ok(T) if self can be cast into T, otherwise calls on_err.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.