Tensor.CreateScalar<T> Method

Constructs a 0-dimensional tensor that represents a scalar value.

Definition

Namespace: Numerics.NET.Tensors
Assembly: Numerics.NET.Tensors (in Numerics.NET.Tensors.dll) Version: 9.0.3
C#
public static Tensor<T> CreateScalar<T>(
	T value,
	ArrayMutability mutability = ArrayMutability.MutableValues
)

Parameters

value  T
A scalar value.
mutability  ArrayMutability  (Optional)
Optional. Specifies how the tensor's values may be changed. The default is mutable values.

Type Parameters

T
The type of the elements of the tensor.

Return Value

Tensor<T>
A 0-dimensional tensor whose only value is value.

See Also