Show / Hide Table of Contents

Delegate OrtModelCompilationOptions.GetInitializerLocationDelegate

Delegate called by ORT for every initializer when generating the compiled model. The delegate allows the user to determine whether the initializer should be stored within the compiled model or externally in a file. If the delegate chooses to store an initializer externally, the delegate implementation is responsible for writing the initializer data to a file.

Namespace: Microsoft.ML.OnnxRuntime
Assembly: Microsoft.ML.OnnxRuntime.dll
Syntax
public delegate OrtExternalInitializerInfo OrtModelCompilationOptions.GetInitializerLocationDelegate(string initializerName, IReadOnlyOrtValue initializerValue, IReadOnlyExternalInitializerInfo originalInitializerLocation)
Parameters
Type Name Description
string initializerName

The initializer's name.

IReadOnlyOrtValue initializerValue

The readonly OrtValue instance containing the data, type, and shape of the initializer.

IReadOnlyExternalInitializerInfo originalInitializerLocation

May be null. If the initializer is originally stored externally, this contains the file path, file offset, and data size. Otherwise, this is null.

Returns
Type Description
OrtExternalInitializerInfo

A new OrtExternalInitializerInfo indicating the new location of the initializer. Returns null if the initializer should be stored within the generated compiled model.

Remarks

The return value may be null.

  • Improve this Doc
  • View Source
In This Article
Back to top