Ipython 函数参数提示

问题

  • 遇到不熟悉的函数,可以直接使用 ? 查找帮助手册

解决方案一

e.g.
你不熟悉 np.stack()    的用法
所以 在ipython中


import numpy as np
?np.stack() 

即可查看文档

解决方案二

想了解torch框架中nn.Conv3d的参数

打开ipython
输入
import torch
import torch.nn as nn
help(nn.Conv3d)  即可

解决方案三

In [49]: print(torch.nn.Conv3d.__doc__)
Applies a 3D convolution over an input signal composed of several input
    planes.

    In the simplest case, the output value of the layer with input size :math:`(N, C_{in}, D, H, W)`
    and output :math:`(N, C_{out}, D_{out}, H_{out}, W_{out})` can be precisely described as:

    .. math::
        out(N_i, C_{out_j}) = bias(C_{out_j}) +
                                \sum_{k = 0}^{C_{in} - 1} weight(C_{out_j}, k) \star input(N_i, k)

    where :math:`\star` is the valid 3D `cross-correlation`_ operator

    * :attr:`stride` controls the stride for the cross-correlation.

你可能感兴趣的:(python)