Function tidy

  • Executes the provided function and cleans up all intermediate tensors allocated. Any tensors returned will remain in memory.

    Type Parameters

    • T extends TensorContainer

    Parameters

    • nameOrFn: string | ScopeFn<T>

      the name of the closure, or the function to execute.

    • Optional fn: ScopeFn<T>

      (optional) the function to execute

    Returns T

    (optional) tensors