我试图理解这个操作符@在python中使用了什么。 我看到了一些关于矩阵多重化的东西,但事实并非如此,我将举一个例子:
@property
def num_reserved_ids(self):
return 0
或:
@registry.register_problem()
class LibrispeechNoisy(Librispeech):
最后一个:
@registry.register_hparams
def transformer_librispeech_tpu_v1():
"""HParams for training ASR model on Librispeech on TPU v1."""
hparams = transformer_librispeech_v1()
update_hparams_for_tpu(hparams)
注册表是在中使用的另一个文件程序寄存器\u hparams是一个函数。 不知道“属性”是什么,但即使我知道它是什么,我也不能理解操作符的目的:@,我有点慢,抱歉:/。。你知道吗
如果有人想寻找更多的代码,可以查看Tensor2传感器库: https://github.com/tensorflow/tensor2tensor/tree/master/tensor2tensor
我想你要找的是Python
这是Wiki For Python Decorators
理解它们的最好方法是从Corey Schafer's Video on Python Decorators
相关问题 更多 >
编程相关推荐