Unity
  • NatML for Unity
  • Preliminaries
    • Getting Started
    • Requirements
  • Workflows
    • Core Concepts
    • Fetching Models
    • Using Predictors
  • Authoring
    • Creating Predictors
    • Distributing Predictors
  • API Reference
    • IMLPredictor
    • MLModel
      • MLEdgeModel
        • Configuration
      • MLCloudModel
    • MLFeature
      • MLArrayFeature
      • MLImageFeature
      • MLStringFeature
      • MLAudioFeature
      • MLVideoFeature
      • MLDepthFeature
      • MLXRCpuDepthFeature
    • MLFeatureType
      • MLArrayType
      • MLAudioType
      • MLImageType
      • MLVideoType
      • MLStringType
    • MLPredictorExtensions
  • Integrations
    • Media Devices
    • Augmented Reality
    • Video Recording
  • Insiders
    • Changelog
    • Open Source
    • GitHub
    • Discord
    • Blog
Powered by GitBook
On this page
  • Creating the Type
  • Inspecting the Type
  • Inspecting the Shape
  • Dimensions
  • Element Count

Was this helpful?

  1. API Reference
  2. MLFeatureType

MLArrayType

class NatML.Types.MLArrayType : MLFeatureType

This feature type describes multidimensional arrays or tensors.

Creating the Type

/// <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);

Inspecting the Type

/// <summary>
/// Feature name.
/// </summary>
string name { get; }

/// <summary>
/// Feature data type.
/// This will typically be a numeric type.
/// </summary>
Type dataType { get; }

Inspecting the Shape

/// <summary>
/// Array shape.
/// </summary>
int[] shape { get; }

The array type provides the shape of its corresponding feature.

Dimensions

/// <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.

Element Count

/// <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.

PreviousMLFeatureTypeNextMLAudioType

Last updated 2 years ago

Was this helpful?

Refer to the class for more information.

MLFeatureType