Interface CompiledModel#

interface CompiledModel {
    inputs: Output[];
    outputs: Output[];
    getProperty(propertyName): string | number | boolean;
    createInferRequest(): InferRequest;
    exportModelSync(): Buffer;
    input(): Output;
    input(index): Output;
    input(name): Output;
    output(): Output;
    output(index): Output;
    output(name): Output;
    setProperty(properties: {[propertyName: string]: string | number | boolean}): void;
}

CompiledModel represents a model that is compiled for a specific device by applying multiple optimization transformations, then mapping to compute kernels.

Properties#

inputs

  • inputs: Output []
    

    It gets all inputs of a compiled model.

outputs

  • outputs: Output []
    

    It gets all outputs of a compiled model.

Methods#

getProperty

  • getProperty(propertyName): string | number | boolean
    

    It gets the property for the current compiled model.

    • Parameters:

      • propertyName: string

        A string to get the property value.

    • Returns: string | number | boolean

    • Defined in: addon.ts:313

createInferRequest

  • createInferRequest(): InferRequest
    

    It creates an inference request object used to infer the compiled model.

exportModelSync

  • exportModelSync(): Buffer
    
    • Returns: Buffer

input

  • input(): Output
    

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

    input(index): Output
    

    It gets input of a compiled model identified by an index.

    • Parameters:

      • index: number

        An input tensor index.

    • Returns: Output

      A compiled model input.

    • Defined in: addon.ts:355

    input(name): Output
    

    It gets input of a compiled model identified by an index.

    • Parameters:

      • name: string

        An input tensor name.

    • Returns: Output

      A compiled model input.

    • Defined in: addon.ts:361

output

  • output(): Output
    

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

    output(index): Output
    

    It gets output of a compiled model identified by an index.

    • Parameters:

      • index: number
        

        An output tensor index.

    • Returns: Output

      A compiled model output.

    • Defined in: addon.ts:337

    output(name): Output
    

    It gets output of a compiled model identified by a tensorName.

    • Parameters:

      • name: string
        

        An output tensor name.

    • Returns: Output

      A compiled model output.

    • Defined in: addon.ts:343

setProperty

  • setProperty(properties): void
    

    It sets properties for the current compiled model. Properties can be retrieved via CompiledModel.getProperty

    • Parameters:

      • properties: {
                  [propertyName: string]: string | number | boolean;
         }
        

        An object with the key-value pairs (property name, property value).

    • Returns: void

    • Defined in: addon.ts:368