快捷方式

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) 預設值: True

  • skip (int) – 儲存的 tensordict 的幀間隔。預設值: 4

文件

查閱 PyTorch 的全面開發者文件

檢視文件

教程

獲取適用於初學者和高階開發者的深入教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源