InferRequest#

interface InferRequest {
    getCompiledModel(): CompiledModel;
    getInputTensor(idx?): Tensor;
    getOutputTensor(idx?): Tensor;
    getTensor(nameOrOutput): Tensor;
    infer(inputData?): {
        [outputName: string]: Tensor;
    };
    inferAsync(inputData): Promise<{
        [outputName: string]: Tensor;
    }>;
    setInputTensor(idxOrTensor, tensor?): void;
    setOutputTensor(idxOrTensor, tensor?): void;
    setTensor(name, tensor): void;
}

Methods#

getCompiledModel

getCompiledModel(): CompiledModel

getInputTensor

getInputTensor(idx?): Tensor

getOutputTensor

getOutputTensor(idx?): Tensor

getTensor

getTensor(nameOrOutput): Tensor

infer

infer(inputData?): {
    [outputName: string]: Tensor;
}
  • Parameters:

    • Optional

      inputData: {
                 [inputName: string]: Tensor | SupportedTypedArray;
                 } | Tensor[] | SupportedTypedArray[]
      
  • Returns:

    {
    [outputName: string]: Tensor;
    }
    
    • [outputName: string]: Tensor

  • Defined in: addon.ts:108

inferAsync

inferAsync(inputData): Promise<{
    [outputName: string]: Tensor;
}>
  • Parameters:

    • inputData: Tensor[] | {
          [inputName: string]: Tensor;
      }
      
  • Returns:

    Promise<{
     [outputName: string]: Tensor;
    }>
    
  • Defined in: addon.ts:110

setInputTensor

setInputTensor(idxOrTensor, tensor?): void
  • Parameters:

    • idxOrTensor: number| Tensor

    • Optional

      tensor: Tensor
      
  • Returns: void

  • Defined in: addon.ts:103

setOutputTensor

setOutputTensor(idxOrTensor, tensor?): void
  • Parameters:

    • idxOrTensor: number| Tensor

    • Optional

      tensor: Tensor
      
  • Returns: void

  • Defined in: addon.ts:104

setTensor

setTensor(name, tensor): void