# Class InferenceSession

java.lang.Object
com.codename1.ai.inference.InferenceSession

All Implemented Interfaces:
  `AutoCloseable`

public final class InferenceSession extends Object implements AutoCloseable
Reusable LiteRT model session.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `TensorInfo[]`
  `getInputs()`
  `TensorInfo[]`
  `getOutputs()`
  `static boolean`
  `isSupported()`
  `static AsyncResource<InferenceSession>`
  `open(ModelSource source, InferenceOptions options)`
  `void`
  `resizeInput(String name, int[] shape)`
  `AsyncResource<Tensor[]>`
  `run(Tensor[] inputs)`

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### isSupported

    public static boolean isSupported()

  - ### open

    public static AsyncResource<InferenceSession> open(ModelSource source, InferenceOptions options)

  - ### getInputs

    public TensorInfo[] getInputs()

  - ### getOutputs

    public TensorInfo[] getOutputs()

  - ### run

    public AsyncResource<Tensor[]> run(Tensor[] inputs)

  - ### resizeInput

    public void resizeInput(String name, int[] shape)

  - ### close

    public void close()
    Specified by:
      `close` in interface `AutoCloseable`