Tensor.Broadcast Method
Definition
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.
Overloads
Broadcast<T>(ReadOnlyTensorSpan<T>, ReadOnlyTensorSpan<T>) |
Broadcast the data from |
Broadcast<T>(ReadOnlyTensorSpan<T>, ReadOnlySpan<IntPtr>) |
Broadcast the data from |
Broadcast<T>(ReadOnlyTensorSpan<T>, ReadOnlyTensorSpan<T>)
- Source:
- TensorExtensions.cs
Broadcast the data from source
to the smallest broadcastable shape compatible with lengthsSource
. Creates a new Tensor<T> and allocates new memory.
public:
generic <typename T>
static System::Numerics::Tensors::Tensor<T> ^ Broadcast(System::Numerics::Tensors::ReadOnlyTensorSpan<T> % source, System::Numerics::Tensors::ReadOnlyTensorSpan<T> % lengthsSource);
public static System.Numerics.Tensors.Tensor<T> Broadcast<T> (scoped in System.Numerics.Tensors.ReadOnlyTensorSpan<T> source, scoped in System.Numerics.Tensors.ReadOnlyTensorSpan<T> lengthsSource);
static member Broadcast : ReadOnlyTensorSpan * ReadOnlyTensorSpan -> System.Numerics.Tensors.Tensor<'T>
Public Function Broadcast(Of T) (ByRef source As ReadOnlyTensorSpan(Of T), ByRef lengthsSource As ReadOnlyTensorSpan(Of T)) As Tensor(Of T)
Type Parameters
- T
Parameters
- source
- ReadOnlyTensorSpan<T>
Input Tensor<T>.
- lengthsSource
- ReadOnlyTensorSpan<T>
Other Tensor<T> to make shapes broadcastable.
Returns
Applies to
Broadcast<T>(ReadOnlyTensorSpan<T>, ReadOnlySpan<IntPtr>)
- Source:
- TensorExtensions.cs
Broadcast the data from source
to the new shape lengths
. Creates a new Tensor<T> and allocates new memory.
If the shape of the source
is not compatible with the new shape, an exception is thrown.
public:
generic <typename T>
static System::Numerics::Tensors::Tensor<T> ^ Broadcast(System::Numerics::Tensors::ReadOnlyTensorSpan<T> % source, ReadOnlySpan<IntPtr> lengths);
public static System.Numerics.Tensors.Tensor<T> Broadcast<T> (scoped in System.Numerics.Tensors.ReadOnlyTensorSpan<T> source, scoped ReadOnlySpan<IntPtr> lengths);
static member Broadcast : ReadOnlyTensorSpan * ReadOnlySpan<nativeint> -> System.Numerics.Tensors.Tensor<'T>
Public Function Broadcast(Of T) (ByRef source As ReadOnlyTensorSpan(Of T), lengths As ReadOnlySpan(Of IntPtr)) As Tensor(Of T)
Type Parameters
- T
Parameters
- source
- ReadOnlyTensorSpan<T>
Input Tensor<T>.
- lengths
-
ReadOnlySpan<nativeint>
ReadOnlySpan<T> of the desired new shape.
Returns
Exceptions
Thrown when the shapes are not broadcast compatible.