morflow library

Morflow: data processing and tensor transformation pipelines.

Compile a .morf pipeline with load or fromStr, then run it with the methods on Pipeline:

import 'dart:typed_data';
import 'package:morflow/morflow.dart' as morflow;

final pipeline = morflow.fromStr('''
  accept Tensor $tensor
  $tensor >> base/latest/identity >> emit
''');
final output = await pipeline.run<morflow.MorflowTensor>(Float32List.fromList([1, 2, 3]));
print(output.toFloat32Array());

Run inputs are a TensorInput, typed data (a 1-D tensor of its dtype), a Uint8List of raw bytes, or a List of those, sent as a Composite.

Classes

MorflowTensor
An emitted tensor. A Composite output is a List of outputs instead.
Pipeline
A compiled pipeline.
TensorInput
A tensor, image or audio input with an explicit shape.

Constants

tensorDTypes → const List<String>
Every tensor element type.

Functions

fromStr(String source) → Pipeline
Compiles a .morf pipeline DSL source string directly.
fromString(String source) → Pipeline
Alias for fromStr.
load(String path) → Pipeline
Compiles and loads a .morf pipeline file from disk.

Exceptions / Errors

MorflowException
An error reported by the Morflow engine: a pipeline that fails to parse or compile, an action error, or an input it cannot accept.