TrainerHookBase¶ class torchrl.trainers.TrainerHookBase[source]¶ torchrl Trainer 類的抽象鉤子類。 abstract register(trainer: Trainer, name: str)[source]¶ Registers the hook in the trainer at a default location. 引數: trainer (Trainer) – the trainer where the hook must be registered. name (str) – the name of the hook. 注意 To register the hook at another location than the default, use register_op().