MLArrayType
class NatML.Types.MLArrayType : MLFeatureType
This feature type describes multidimensional arrays or tensors.
/// <summary>
/// Create an array feature type.
/// </summary>
/// <param name="type">Array element type.</param>
/// <param name="shape">Array feature shape.</param>
MLArrayType (Type type, int[] shape);
An array type is created with a data type and a corresponding shape.
Even though array types can be created without a
shape
, this should be avoided.There is another constructor which accepts a feature name:
/// <summary>
/// Create an array feature type.
/// </summary>
/// <param name="name">Feature name.</param>
/// <param name="type">Array element type.</param>
/// <param name="shape">Array feature shape.</param>
MLArrayType (string name, Type type, int[] shape);
/// <summary>
/// Feature name.
/// </summary>
string name { get; }
/// <summary>
/// Feature data type.
/// This will typically be a numeric type.
/// </summary>
Type dataType { get; }
/// <summary>
/// Array shape.
/// </summary>
int[] shape { get; }
The array type provides the shape of its corresponding feature.
/// <summary>
/// Array dimensions.
/// </summary>
int dims { get; }
The type provides a convenience property for the number of dimensions which the array feature has.
This is always the number of elements in the
shape
./// <summary>
/// Array element count.
/// </summary>
int elementCount { get; }
The type provides a convenience property for the number of elements which the array feature has.
This is always the product of the elements in the
shape
.Last modified 1yr ago