Tensor.CreateRandom Method

Definition

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

Overload List

CreateRandom(TensorShape, ArrayMutability) Constructs a new tensor with uniform random numbers between 0 and 1.
Obsolete
CreateRandom(TensorShape, Random, ArrayMutability) Constructs a new tensor with uniform random numbers between 0 and 1.
Obsolete

CreateRandom(TensorShape, ArrayMutability)

Note: This API is now obsolete.
Constructs a new tensor with uniform random numbers between 0 and 1.
C#
[ObsoleteAttribute("Use the Random method instead.")]
public static Tensor<double> CreateRandom(
	TensorShape shape,
	ArrayMutability mutability = ArrayMutability.MutableValues
)

Parameters

shape  TensorShape
The shape of the tensor.
mutability  ArrayMutability  (Optional)
Optional. Specifies how the tensor's values may be changed. The default is mutable values.

Return Value

Tensor<Double>
A Tensor<T>.

Exceptions

ArgumentException

shape is not a valid tensor shape.

CreateRandom(TensorShape, Random, ArrayMutability)

Note: This API is now obsolete.
Constructs a new tensor with uniform random numbers between 0 and 1.
C#
[ObsoleteAttribute("Use the Random method instead.")]
public static Tensor<double> CreateRandom(
	TensorShape shape,
	Random random,
	ArrayMutability mutability = ArrayMutability.MutableValues
)

Parameters

shape  TensorShape
The shape of the tensor.
random  Random
The random number generator to use.
mutability  ArrayMutability  (Optional)
Optional. Specifies how the tensor's values may be changed. The default is mutable values.

Return Value

Tensor<Double>
A Tensor<T>.

Exceptions

ArgumentException

shape is not a valid tensor shape.

See Also