Rate this Page
★ ★ ★ ★ ★

TensorDictFuture#

class tensordict.utils.TensorDictFuture(futures, resulting_td)#

Bases: object

A custom future class for TensorDict multithreaded operations.

Parameters:
  • futures (list of futures) – a list of concurrent.futures.Future objects to wait for.

  • resulting_td (TensorDictBase) – instance that will result from the futures completing.

result()#

Wait and returns the resulting tensordict.

Raises the first error of the futures, if any.