Small mound--pytorch--official document reading

foreword

Recently, I am learning pytorch. I watched the video of the up master’s small mound. In the video, the up master’s ability to read the official documents is relatively strong. Record the following up master’s summary. It is indeed much easier to read the documents.


1. Steps

The following steps have taken transforms.Normalize as an example.
In pycharm, when you encounter a function or class that you are not familiar with, hold down ctrl, and then click the class and function with the left mouse button. You can view the usage of the class or function.
insert image description here
insert image description here

1. First look at the __init__ function,
insert image description here
indicating that the parameters mean and std need to be passed in when creating an object, and inplace can use the default one. See the
comments of the parameters, and what type of parameters should be passed in can
insert image description here
be obtained from the figure, mean and std are two lists, the length of the list is the number of channels of the input tensor
2. Then create an object of this class
insert image description here
3. Call the method of the object to get the output, and specify what type
insert image description here
the output is. The method passes in the tensor data type, input is the tensor data type after normalization.
insert image description here

Summarize

I don't know much about the object-oriented grammar of python, so it is very difficult to read the document. I should study this knowledge later

Guess you like

Origin blog.csdn.net/weixin_47250738/article/details/130201435