fangwei123456 / spikingjelly

SpikingJelly is an open-source deep learning framework for Spiking Neural Network (SNN) based on PyTorch.
https://spikingjelly.readthedocs.io
Other
1.35k stars 239 forks source link

Dropout API的中英文跳转 #63

Closed fangwei123456 closed 3 years ago

fangwei123456 commented 3 years ago

https://github.com/fangwei123456/spikingjelly/blob/6657f2a65fd17f1158796356fbcad9c5311295cf/spikingjelly/clock_driven/layer.py#L191

本地编译文档的时候会报警告:

C:\Users\fw\Desktop\代码\spikingjelly\spikingjelly\clock_driven\layer.py:docstring of spikingjelly.clock_driven.layer.Dropout:1: WARNING: undefined label: dropout.__init__-en
C:\Users\fw\Desktop\代码\spikingjelly\spikingjelly\clock_driven\layer.py:docstring of spikingjelly.clock_driven.layer.Dropout:28: WARNING: undefined label: dropout.__init__-cn
C:\Users\fw\Desktop\代码\spikingjelly\spikingjelly\clock_driven\layer.py:docstring of spikingjelly.clock_driven.layer.Dropout2d:1: WARNING: undefined label: dropout2d.__init__-en
C:\Users\fw\Desktop\代码\spikingjelly\spikingjelly\clock_driven\layer.py:docstring of spikingjelly.clock_driven.layer.Dropout2d:11: WARNING: undefined label: dropout.__init__-cn
C:\Users\fw\Desktop\代码\spikingjelly\spikingjelly\clock_driven\layer.py:docstring of spikingjelly.clock_driven.layer.Dropout2d:13: WARNING: undefined label: dropout2d.__init__-cn
C:\Users\fw\Desktop\代码\spikingjelly\spikingjelly\clock_driven\layer.py:docstring of spikingjelly.clock_driven.layer.Dropout2d:24: WARNING: undefined label: dropout.__init__-en
C:\Users\fw\Desktop\代码\spikingjelly\spikingjelly\clock_driven\layer.py:docstring of spikingjelly.clock_driven.layer.MultiStepDropout:1: WARNING: undefined label: dropout.__init__-en
C:\Users\fw\Desktop\代码\spikingjelly\spikingjelly\clock_driven\layer.py:docstring of spikingjelly.clock_driven.layer.MultiStepDropout:28: WARNING: undefined label: dropout.__init__-cn
C:\Users\fw\Desktop\代码\spikingjelly\spikingjelly\clock_driven\layer.py:docstring of spikingjelly.clock_driven.layer.MultiStepDropout2d:1: WARNING: undefined label: dropout2d.__init__-en
C:\Users\fw\Desktop\代码\spikingjelly\spikingjelly\clock_driven\layer.py:docstring of spikingjelly.clock_driven.layer.MultiStepDropout2d:11: WARNING: undefined label: dropout.__init__-cn
C:\Users\fw\Desktop\代码\spikingjelly\spikingjelly\clock_driven\layer.py:docstring of spikingjelly.clock_driven.layer.MultiStepDropout2d:13: WARNING: undefined label: dropout2d.__init__-cn
C:\Users\fw\Desktop\代码\spikingjelly\spikingjelly\clock_driven\layer.py:docstring of spikingjelly.clock_driven.layer.MultiStepDropout2d:24: WARNING: undefined label: dropout.__init__-en
C:\Users\fw\Desktop\代码\spikingjelly\spikingjelly\clock_driven\layer.py:docstring of spikingjelly.clock_driven.layer.DropConnectLinear:16: WARNING: undefined label: dropout.__init__-cn
C:\Users\fw\Desktop\代码\spikingjelly\spikingjelly\clock_driven\layer.py:docstring of spikingjelly.clock_driven.layer.DropConnectLinear:49: WARNING: undefined label: dropout.__init__-en
fangwei123456 commented 3 years ago

查明了,这个问题是由于

https://github.com/fangwei123456/spikingjelly/blob/6657f2a65fd17f1158796356fbcad9c5311295cf/spikingjelly/clock_driven/layer.py#L321

MultiStepDropout直接继承了Dropout,没有写init函数和api,因此文档也自动继承了Dropout的init函数的api,导致出现了重复的dropout.init-en定义。