TensorSpan<T> Struct
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
TensorSpan represents a contiguous region of arbitrary memory. Unlike arrays, it can point to either managed or native memory, or to memory allocated on the stack. It is type-safe and memory-safe.
generic <typename T>
public value class TensorSpan
[System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public readonly ref struct TensorSpan<T>
[<System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type TensorSpan<'T> = struct
Public Structure TensorSpan(Of T)
- T
- Inheritance
- Attributes
Tensor |
Creates a new TensorSpan<T> over the provided Array using the specified start offsets, lengths, and strides. If the strides are not provided, they will be automatically calculated. |
Tensor |
Creates a new TensorSpan<T> over the provided Array using the specified start offsets, lengths, and strides. If the strides are not provided, they will be automatically calculated. |
Tensor |
Creates a new TensorSpan<T> over the provided Array. The new TensorSpan<T> will have a rank of 1 and a length equal to the length of the provided Array. |
Tensor |
Creates a new TensorSpan<T> over the provided Span<T> using the specified lengths and strides. If the strides are not provided, they will be automatically calculated. |
Tensor |
Creates a new TensorSpan<T> over the provided Span<T>. The new TensorSpan<T> will have a rank of 1 and a length equal to the length of the provided Span<T>. |
Tensor |
Creates a new span over the portion of the target array beginning at 'start' index and ending at 'end' index (exclusive). |
Tensor |
Creates a new span over the portion of the target array beginning at 'start' index and ending at 'end' index (exclusive). |
Tensor |
Creates a new span over the entirety of the target array. |
Tensor |
Creates a new span over the target unmanaged buffer. Clearly this is quite dangerous, because the length is not checked. But if this creation is correct, then all subsequent uses are correct. |
Tensor |
Creates a new span over the target unmanaged buffer. Clearly this is quite dangerous the length is not checked. But if this creation is correct, then all subsequent uses are correct. |
Empty |
Returns an empty TensorSpan<T> |
Flattened |
The number of items in the span. |
Is |
Gets a value indicating whether this TensorSpan<T> is empty. |
Item[Read |
Returns a reference to specified element of the TensorSpan. |
Item[Read |
Returns a reference to specified element of the TensorSpan. |
Item[Read |
Returns a slice of the TensorSpan. |
Lengths |
Gets the length of each dimension in this TensorSpan<T>. |
Rank |
Gets the rank, aka the number of dimensions, of this TensorSpan<T>. |
Strides |
Gets the strides of this TensorSpan<T> |
Clear() |
Clears the contents of this span. |
Copy |
Copies the contents of this span into destination span. If the source and destinations overlap, this method behaves as if the original values in a temporary location before the destination is overwritten. |
Equals(Object) |
Obsolete.
This method is not supported as spans cannot be boxed. To compare two spans, use operator==. |
Fill(T) |
Fills the contents of this span with the given value. |
Flatten |
Flattens the contents of this span into the provided Span<T>. |
Get |
Gets an enumerator for this span. |
Get |
Obsolete.
This method is not supported as spans cannot be boxed. |
Get |
Returns a reference to the 0th element of the TensorSpan. If the TensorSpan is empty, returns null reference. It can be used for pinning and is required to support the use of span within a fixed statement. |
Slice(Read |
Returns a reference to specified element of the TensorSpan. |
Slice(Read |
Forms a slice out of the given span |
To |
For Span<T>, returns a new instance of string that represents the characters pointed to by the span. Otherwise, returns a String with the name of the type and the number of elements. |
Try |
Copies the contents of this span into destination span. If the source and destinations overlap, this method behaves as if the original values in a temporary location before the destination is overwritten. |
Try |
Flattens the contents of this span into the provided Span<T>. |
Equality(Tensor |
Returns true if left and right point at the same memory and have the same length. Note that this does not check to see if the contents are equal. |
Implicit(T[] to Tensor |
|
Implicit(Tensor |
Converts a TensorSpan<T> to a ReadOnlyTensorSpan<T>. |
Inequality(Tensor |
Returns false if left and right point at the same memory and have the same length. Note that this does not check to see if the contents are equal. |
Broadcast |
Broadcast the data from |
Filtered |
Updates the |
Filtered |
Updates the |
Reshape<T>(Tensor |
Reshapes the |
Sequence |
Determines whether two sequences are equal by comparing the elements using IEquatable{T}.Equals(T). |
Set |
Sets a slice of the given |
Squeeze<T>(Tensor |
Removes all dimensions of length one from the |
Squeeze |
Removes axis of length one from the |
To |
Creates a String representation of the TensorSpan<T>."/> |
Try |
Broadcast the data from |
Unsqueeze<T>(Tensor |
Insert a new dimension of length 1 that will appear at the dimension position. |
제품 | 버전 |
---|---|
.NET | 8 (package-provided), 9 (package-provided) |
.NET 피드백
.NET은(는) 오픈 소스 프로젝트입니다. 다음 링크를 선택하여 피드백을 제공해 주세요.