/usr/local/lib64/python3.6/site-packages/torch/nn/modules/__pycache__
NameSizeModeActions
activation.cpython-36.pyc476350644editdlrm
adaptive.cpython-36.pyc97250644editdlrm
batchnorm.cpython-36.pyc310390644editdlrm
channelshuffle.cpython-36.pyc19010644editdlrm
container.cpython-36.pyc279700644editdlrm
conv.cpython-36.pyc577890644editdlrm
distance.cpython-36.pyc36840644editdlrm
dropout.cpython-36.pyc103100644editdlrm
flatten.cpython-36.pyc58130644editdlrm
fold.cpython-36.pyc128070644editdlrm
instancenorm.cpython-36.pyc188080644editdlrm
lazy.cpython-36.pyc116900644editdlrm
linear.cpython-36.pyc101880644editdlrm
loss.cpython-36.pyc914650644editdlrm
module.cpython-36.pyc665300644editdlrm
normalization.cpython-36.pyc113600644editdlrm
padding.cpython-36.pyc222170644editdlrm
pixelshuffle.cpython-36.pyc43980644editdlrm
pooling.cpython-36.pyc532030644editdlrm
rnn.cpython-36.pyc446530644editdlrm
sparse.cpython-36.pyc209560644editdlrm
transformer.cpython-36.pyc207370644editdlrm
upsampling.cpython-36.pyc107800644editdlrm
utils.cpython-36.pyc25280644editdlrm
_functions.cpython-36.pyc54410644editdlrm
__init__.cpython-36.pyc52360644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/torch/nn/modules/__pycache__/linear.cpython-36.pyc (10188B)
3 Ege(@sddlZddlZddlmZddlmZmZddlmZddlm Z ddl m Z dd l m Z Gd d d e ZGd d d e ZGdddeZGddde ZGddde eZdS)N)Tensor) ParameterUninitializedParameter) functional)init)Module)LazyModuleMixincs0eZdZdZfddZeedddZZS)IdentityaA placeholder identity operator that is argument-insensitive. Args: args: any argument (unused) kwargs: any keyword argument (unused) Shape: - Input: :math:`(*)`, where :math:`*` means any number of dimensions. - Output: :math:`(*)`, same shape as the input. Examples:: >>> m = nn.Identity(54, unused_argument1=0.1, unused_argument2=False) >>> input = torch.randn(128, 20) >>> output = m(input) >>> print(output.size()) torch.Size([128, 20]) cstt|jdS)N)superr __init__)selfargskwargs) __class__C/usr/local/lib64/python3.6/site-packages/torch/nn/modules/linear.pyr szIdentity.__init__)inputreturncCs|S)Nr)rrrrrforward#szIdentity.forward)__name__ __module__ __qualname____doc__r rr __classcell__rr)rrr s r cspeZdZUdZddgZeee deee ddfdd Z dd d d Z eed d dZ ed ddZZS)LinearaApplies a linear transformation to the incoming data: :math:`y = xA^T + b` This module supports :ref:`TensorFloat32`. Args: in_features: size of each input sample out_features: size of each output sample bias: If set to ``False``, the layer will not learn an additive bias. Default: ``True`` Shape: - Input: :math:`(*, H_{in})` where :math:`*` means any number of dimensions including none and :math:`H_{in} = \text{in\_features}`. - Output: :math:`(*, H_{out})` where all but the last dimension are the same shape as the input and :math:`H_{out} = \text{out\_features}`. Attributes: weight: the learnable weights of the module of shape :math:`(\text{out\_features}, \text{in\_features})`. The values are initialized from :math:`\mathcal{U}(-\sqrt{k}, \sqrt{k})`, where :math:`k = \frac{1}{\text{in\_features}}` bias: the learnable bias of the module of shape :math:`(\text{out\_features})`. If :attr:`bias` is ``True``, the values are initialized from :math:`\mathcal{U}(-\sqrt{k}, \sqrt{k})` where :math:`k = \frac{1}{\text{in\_features}}` Examples:: >>> m = nn.Linear(20, 30) >>> input = torch.randn(128, 20) >>> output = m(input) >>> print(output.size()) torch.Size([128, 30]) in_features out_featuresTN)rrbiasrcsn||d}tt|j||_||_ttj||ff||_|rVttj|f||_ n |j dd|j dS)N)devicedtyper) r rr rrrtorchemptyweightrregister_parameterreset_parameters)rrrrr r!factory_kwargs)rrrr Os  zLinear.__init__)rcCs`tj|jtjdd|jdk r\tj|j\}}|dkrFdtj|nd}tj|j| |dS)N)arr)rZkaiming_uniform_r$mathsqrtrZ_calculate_fan_in_and_fan_outuniform_)rZfan_in_boundrrrr&\s  zLinear.reset_parameters)rrcCstj||j|jS)N)FZlinearr$r)rrrrrrfszLinear.forwardcCsdj|j|j|jdk S)Nz(in_features={}, out_features={}, bias={})formatrrr)rrrr extra_repriszLinear.extra_repr)TNN)rrrr __constants__intrrrr$boolr r&rstrr1rrr)rrr's "  rcs*eZdZdeeeddfdd ZZS)NonDynamicallyQuantizableLinearTN)rrrrcstj|||||ddS)N)rr r!)r r )rrrrr r!)rrrr us z(NonDynamicallyQuantizableLinear.__init__)TNN)rrrr3r4r rrr)rrr6tsr6cszeZdZUdZdddgZeeee  deeee ddfdd Z dd d d Z e e e d ddZed ddZZS)BilinearaApplies a bilinear transformation to the incoming data: :math:`y = x_1^T A x_2 + b` Args: in1_features: size of each first input sample in2_features: size of each second input sample out_features: size of each output sample bias: If set to False, the layer will not learn an additive bias. Default: ``True`` Shape: - Input1: :math:`(N, *, H_{in1})` where :math:`H_{in1}=\text{in1\_features}` and :math:`*` means any number of additional dimensions. All but the last dimension of the inputs should be the same. - Input2: :math:`(N, *, H_{in2})` where :math:`H_{in2}=\text{in2\_features}`. - Output: :math:`(N, *, H_{out})` where :math:`H_{out}=\text{out\_features}` and all but the last dimension are the same shape as the input. Attributes: weight: the learnable weights of the module of shape :math:`(\text{out\_features}, \text{in1\_features}, \text{in2\_features})`. The values are initialized from :math:`\mathcal{U}(-\sqrt{k}, \sqrt{k})`, where :math:`k = \frac{1}{\text{in1\_features}}` bias: the learnable bias of the module of shape :math:`(\text{out\_features})`. If :attr:`bias` is ``True``, the values are initialized from :math:`\mathcal{U}(-\sqrt{k}, \sqrt{k})`, where :math:`k = \frac{1}{\text{in1\_features}}` Examples:: >>> m = nn.Bilinear(20, 30, 40) >>> input1 = torch.randn(128, 20) >>> input2 = torch.randn(128, 30) >>> output = m(input1, input2) >>> print(output.size()) torch.Size([128, 40]) in1_features in2_featuresrTN)r8r9rrrcsv||d}tt|j||_||_||_ttj|||ff||_ |r^ttj|f||_ n |j dd|j dS)N)r r!r) r r7r r8r9rrr"r#r$rr%r&)rr8r9rrr r!r')rrrr s  zBilinear.__init__)rcCsHdtj|jjd}tj|j| ||jdk rDtj|j| |dS)Nr)r*r+r$sizerr,r)rr.rrrr&s zBilinear.reset_parameters)input1input2rcCstj|||j|jS)N)r/Zbilinearr$r)rr;r<rrrrszBilinear.forwardcCsdj|j|j|j|jdk S)Nz:in1_features={}, in2_features={}, out_features={}, bias={})r0r8r9rr)rrrrr1szBilinear.extra_repr)TNN)rrrrr2r3r8r9rrr$r4r r&rr5r1rrr)rrr7{s % r7csZeZdZUdZeZeed e e ddfdd Z ddfdd Z ddd d Z ZS) LazyLinearaA :class:`torch.nn.Linear` module where `in_features` is inferred. In this module, the `weight` and `bias` are of :class:`torch.nn.UninitializedParameter` class. They will be initialized after the first call to ``forward`` is done and the module will become a regular :class:`torch.nn.Linear` module. The ``in_features`` argument of the :class:`Linear` is inferred from the ``input.shape[-1]``. Check the :class:`torch.nn.modules.lazy.LazyModuleMixin` for further documentation on lazy modules and their limitations. Args: out_features: size of each output sample bias: If set to ``False``, the layer will not learn an additive bias. Default: ``True`` Attributes: weight: the learnable weights of the module of shape :math:`(\text{out\_features}, \text{in\_features})`. The values are initialized from :math:`\mathcal{U}(-\sqrt{k}, \sqrt{k})`, where :math:`k = \frac{1}{\text{in\_features}}` bias: the learnable bias of the module of shape :math:`(\text{out\_features})`. If :attr:`bias` is ``True``, the values are initialized from :math:`\mathcal{U}(-\sqrt{k}, \sqrt{k})` where :math:`k = \frac{1}{\text{in\_features}}` TN)rrrcs@||d}tjdddtf||_||_|rr"Zno_gradshaperr$Z materializerrr&)rrrrrinitialize_parameterss   z LazyLinear.initialize_parameters)TNN)rrrrrZ cls_to_becomerr$rr3r4r r&rArrr)rrr=s  r=)r*r"rZtorch.nn.parameterrrrr/rmoduler Zlazyr r rr6r7r=rrrrs     MJ