Contents

NDArrayDescriptor

A description of an array’s shape, scalar type, and memory layout expectations.

Declaration

struct NDArrayDescriptor

Overview

You obtain an NDArrayDescriptor from an InferenceFunctionDescriptor by querying the descriptor of a specific input or output:

let valueDescriptor = functionDescriptor.inputDescriptor(of: "x")!
guard case .ndArray(let ndArrayDescriptor) = valueDescriptor else { ... }

The descriptor contains the expectations for an array value that you provide to an InferenceFunction. Most expectations are strict: for example, if the descriptor specifies scalarType as .float32, the array you provide must use .float32.

Topics

Inspecting descriptor properties

Instance Properties

Instance Methods

See Also

Multidimensional arrays