TensorDictRecorder¶
- torchrl.record.TensorDictRecorder(out_file_base: str, skip_reset: bool = True, skip: int = 4, in_keys: Optional[Sequence[str]] = None) None[source]¶
TensorDict 記錄器。
當呼叫 ‘dump’ 方法時,這個類將儲存一個 tensordict 棧,來自於
env.step(td)的結果,儲存到一個檔案中,該檔案的字首由 out_file_base 引數定義。- 引數:
out_file_base (str) – 一個字串,定義了將寫入 tensordict 的檔案字首。
skip_reset (bool) – 如果為
True,列表中的第一個 TensorDict 將被丟棄 (通常是呼叫env.reset()產生的 tensordict) 預設值: Trueskip (int) – 儲存的 tensordict 的幀間隔。預設值: 4