PyTorch 中的 'register' 是什么意思?

What do we mean by 'register' in PyTorch?

我不是在问寄存器是存储内容的内存位置。

我问的是 PyTorch 文档中单词 'register' 的用法。

当我阅读有关 MODULE in PyTorch 的文档时,我多次遇到 registers, registered 这个词的用法。

使用上下文如下

1. tensor (Tensor) – buffer to be registered.

2. Submodules assigned in this way will be registered, and will have their parameters converted too when you call to(), etc.

3. Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

4. Registers a backward hook on the module.

5. Registers a forward hook on the module.

.....

而且'register'这个词已经用在了几个方法的名字中

1. register_backward_hook(hook)
 
2. register_buffer(name, tensor, persistent=True)
 
3. register_forward_hook(hook)
 
4. register_forward_pre_hook(hook)

5. register_parameter(name, param)
 
......

以编程方式使用字寄存器是什么意思?

它只是表示 act of recording a name or information on an official list 是简单的英语还是在编程上有任何意义?

pytorch 文档和方法名称中的“注册”是指“在官方列表中记录名称或信息的行为”。
例如,register_backward_hook(hook) 将函数 hook 添加到 nn.Moduleforward 执行过程中执行的其他函数列表中。
同样,register_parameter(name, param) 将带有 namenn.Parameter param 添加到 nn.Module 的可训练参数列表中。 是 to register trainable parameters so pytorch will know what tensors to and what tensors to store as part of the nn.Module's state_dict.