Interface Model#

interface Model {
    inputs: Output[];
    outputs: Output[];
    getFriendlyName(): string;
    getName(): string;
    getOutputShape(index): number[];
    getOutputSize(): number;
    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

inputs: Output[]

outputs

outputs: Output[]

Methods#

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:200

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:196

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.

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:224

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:229

isDynamic

isDynamic(): boolean

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

output

output(nameOrId?): Output

setFriendlyName

setFriendlyName(name): void
  • Parameters:

    • name: string

  • Returns: void

  • Defined in: addon.ts:199