8.21. Clara Structures and Primitives

The Clara pipeline definition language supports types as of api-version 0.5.0 and above.

8.21.1. Clara Structures

Clara type element-type shape
array Mandatory (See primitives table) Mandatory
string Omit Omit
Clara Primitive Omit Omit
stream Mandatory (anything) Omit

string is a special type that is implicitly dynamic and can be interpreted as an array of unit8 of dynamic size updatable by the user-code at runtime.

output:
- name: my-output
  type: string

is the same as

output:
- name: my-output
  type: array
  element-type: uint8
  shape: [-1]

8.21.2. Clara Primitive Types

In the table below we use short-hand notation for the array representation, where for example

array<float32>[3,244,244]

is equivalent to the YAML syntax

type: array
element-type: float32
shape: [3, 224, 224]
Clara Primitive Logical Interpretation array Representation
u8, uint8 8-bit unsigned integer array<uint8>[1]
u16, uint16 16-bit unsigned integer array<uint16>[1]
u32, uint32 32-bit unsigned integer array<uint32>[1]
u64, uint64 64-bit unsigned integer array<uint64>[1]
i8, int8 8-bit unsigned integer array<int8>[1]
i16, int16 16-bit signed integer array<int16>[1]
i32, int32 32-bit signed integer array<int32>[1]
i64, int64 64-bit signed integer array<int64>[1]
f16, float16 16-bit floating-point array<float16>[1]
f32, float32 32-bit floating-point array<float32>[1]
f64, float64 64-bit floating-point array<float64>[1]

8.21.3. Examples of Valid Declarations

Typed volume-based output.

output:
- name: my-output
  type: stream
  element-type: my-stream-type
  path: /my-path

Typed static output array of int32 elements of shape 3 x 224 x 224.

output:
- name: my-output
  type: array
  element-type: int32
  shape: [3, 224, 224]

Typed partially-dynamic output array of int32 elements of shape anything x 224 x 224.

output:
- name: my-output
  type: array
  element-type: int32
  shape: [-1, 224, 224]

Typed primitive of float32.

output:
- name: my-output
  type: float32

String output (implicitly dynamic).

- name: my-output
  type: string