InferRequest

Interface 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

Returns CompiledModel

getInputTensor

getInputTensor(idx?): Tensor

Parameters

  • Optional

    idx: number
    

Returns Tensor

getOutputTensor

getOutputTensor(idx?): Tensor

Parameters

  • Optional

    idx: number
    

Returns Tensor

getTensor

getTensor(nameOrOutput): Tensor

Parameters

  • nameOrOutput: string| Output

Returns Tensor

infer

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

Parameters

  • Optional

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

Returns

{
[outputName: string]: Tensor;
}

inferAsync

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

Parameters

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

Returns

Promise<{
 [outputName: string]: Tensor;
}>

setInputTensor

setInputTensor(idxOrTensor, tensor?): void

Parameters

  • idxOrTensor: number| Tensor

  • Optional

    tensor: Tensor
    

Returns void

setOutputTensor

setOutputTensor(idxOrTensor, tensor?): void

Parameters

  • idxOrTensor: number| Tensor

  • Optional

    tensor: Tensor
    

Returns void

setTensor

setTensor(name, tensor): void

Parameters

Returns void