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