Interface Model#

interface Model {
    clone(): Model;
    inputs: Output[];
    outputs: Output[];
    getFriendlyName(): string;
    getName(): string;
    getOutputShape(index): number[];
    getOutputSize(): number;
    getOutputElementType(index): string;
    input(): Output;
    input(name): Output;
    input(index): Output;
    isDynamic(): boolean;
    output(): Output;
    output(name): Output;
    output(index): Output;
    setFriendlyName(name): void;
}

A user-defined model read by Core.readModel.

Properties#

inputs

outputs

Methods#

clone

getFriendlyName name: getFriendlyName

  • getFriendlyName(): string
    

    It gets the friendly name for a model. If a friendly name is not set via Model.setFriendlyName, a unique model name is returned.

    • Returns: string

      A string with a friendly name of the model.

    • Defined in: addon.ts:240

getName

  • getName(): string
    

    It gets the unique name of the model.

    • Returns: string

      A string with the name of the model.

    • Defined in: addon.ts:245

getOutputShape

  • getOutputShape(): number[]
    

    It returns the shape of the element at the specified index.

getOutputSize

  • getOutputSize(): number[]
    

    It returns the number of the model outputs.

getOutputElementType

  • getOutputElementType(index): string;
    

    It gets the element type of a specific output of the model.

    • Parameters:

      • index: number
        

        The index of the output.

    • Returns: string

    • Defined in: addon.ts:259

input

  • input(): Output
    

    It gets the input of the model. If a model has more than one input, this method throws an exception.

    input(name: string): Output
    

    It gets the input of the model identified by the tensor name.

    • Parameters:

      • Optional

        name: string
        

        The tensor name.

    • Returns: Output

    • Defined in: addon.ts:269

    input(index: number): Output
    

    It gets the input of the model identified by the index.

    • Parameters:

      • Optional

        index: number
        

        The index of the input.

    • Returns: Output

    • Defined in: addon.ts:274

isDynamic

  • isDynamic(): boolean
    

    It returns true if any of the ops defined in the model contains a partial shape.

output

  • output(): Output
    

    It gets the output of the model. If a model has more than one output, this method throws an exception.

output

  • output(name): Output
    

    It gets the output of the model identified by the tensor name.

    output(index): Output
    

    It gets the output of the model identified by the index.

setFriendlyName

  • setFriendlyName(name): void
    

    Sets a friendly name for the model. This does not overwrite the unique model name and is retrieved via Model.getFriendlyName. Mainly used for debugging.

    • Parameters:

      • name: string

    • Returns: void

    • Defined in: addon.ts:301