TensorBackEnd.CreateFromArray Method

Definition

Namespace: Numerics.NET.Tensors
Assembly: Numerics.NET.Tensors (in Numerics.NET.Tensors.dll) Version: 9.0.1

Overload List

CreateFromArray<T>(T[], TensorShape, TensorElementOrder, Boolean) Constructs a new dense tensor of the specifed dimensions, wrapping existing backing memory for the contents.
CreateFromArray<T>(T[], TensorShape, TensorLayout, Boolean) Constructs a new dense tensor of the specifed dimensions, wrapping existing backing memory for the contents.

CreateFromArray<T>(T[], TensorShape, TensorElementOrder, Boolean)

Constructs a new dense tensor of the specifed dimensions, wrapping existing backing memory for the contents.
C#
public abstract Tensor<T> CreateFromArray<T>(
	T[] values,
	TensorShape shape,
	TensorElementOrder order = TensorElementOrder.CStyle,
	bool createView = false
)

Parameters

values  T[]
A 1D array containing the elements of the tensor.
shape  TensorShape
The dimensions of the new tensor.
order  TensorElementOrder  (Optional)
Optional. Specifies the order in which elements are stored in values. The default is C-style (row major).
createView  Boolean  (Optional)
Optional. Specifies whether values should be used to store the tensor's elements. The default is false.

Type Parameters

T

Return Value

Tensor<T>

CreateFromArray<T>(T[], TensorShape, TensorLayout, Boolean)

Constructs a new dense tensor of the specifed dimensions, wrapping existing backing memory for the contents.
C#
public abstract Tensor<T> CreateFromArray<T>(
	T[] values,
	TensorShape shape,
	TensorLayout layout,
	bool createView = false
)

Parameters

values  T[]
A 1D array containing the elements of the tensor.
shape  TensorShape
The dimensions of the new tensor.
layout  TensorLayout
The layout of the tensor elements.
createView  Boolean  (Optional)
Optional. Specifies whether values should be used as storage for the tensor. The default is false.

Type Parameters

T

Return Value

Tensor<T>

See Also