3
I4W^kl  ã               @   sž   d dl Z d dlZd dljZd dlmZmZmZ d dlmZ d dl	m
Z
 d dljjZd dlZd dlZd dlmZ d dlmZ d dlmZ G dd	„ d	ejjƒZdS )
é    N)Úupdate_namesÚcheck_serializing_named_tensorÚresolve_ellipsis)Úunzip_namedshape)ÚOrderedDict)Úimap)Ú_add_docstr)ÚNumberc                   sð  e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd[dd„Zdd„ Zdd„ Z	e
ejjdƒZe
ejjdƒZdd„ Zdd„ Zdd„ Zdd„ Zd\dd„Zd]dd „Zd^d"d#„Zd$d%„ Zd&d'„ Zd_‡ fd)d*„	Zd`d+d,„Zdad-d.„Zd/d0„ Zd1d2„ ZeZejjZejj Z!d3d4„ Z"d5d6„ Z#d7d8„ Z$d9d:„ Z%d;d<„ Z&ejj'Z(ejj)Z*ejj+Z,ejj-Z.ejj/Z0ejj1Z2ejj3Z4ejj5Z6d=d>„ Z7d?d@„ Z8dAdB„ Z9dCdD„ Z:dEZ;dbdFdG„Z<dHdI„ Z=dJdK„ Z>e?dLdM„ ƒZ@‡ fdNdO„ZA‡ fdPdQ„ZB‡ fdRdS„ZCdTdU„ ZDdVdW„ ZE‡ fdXdY„ZFdZZ‡  ZGS )cÚTensorc             C   s6  | j stdƒ‚t| ƒ|kr&|t| ƒ S tjƒ � �ü | jsD| jjdkrN| jƒ }nÎ| j	ƒ j
|ƒ}| jrð| jƒ tjkrˆ| jƒ | jƒ | jƒ f}n>| jƒ tjkr´| jƒ | jƒ | jƒ | jƒ f}ntdj| jƒ ƒƒ‚tjj|| jƒ | jƒ | jƒ || j| jƒ}n,| jƒ }|j|| jƒ | jƒ | jƒ ƒ | j|_||t| ƒ< |S Q R X d S )NzfOnly Tensors created explicitly by the user (graph leaves) support the deepcopy protocol at the momentÚxlaz"Unsupported qscheme {} in deepcopy)Úis_leafÚRuntimeErrorÚidÚtorchZno_gradÚ	is_sparseÚdeviceÚtypeÚcloneÚstorageÚ__deepcopy__Úis_quantizedÚqschemeÚper_tensor_affineÚq_scaleÚq_zero_pointÚper_channel_affineÚq_per_channel_scalesÚq_per_channel_zero_pointsÚq_per_channel_axisÚformatÚ_utilsÚ_rebuild_qtensorÚstorage_offsetÚsizeÚstrideÚrequires_gradÚ_backward_hooksÚnewÚset_)ÚselfÚmemoÚ
new_tensorZnew_storageÚquantizer_params© r-   ú-/tmp/pip-build-e66j97b2/torch/torch/tensor.pyr      s6    

zTensor.__deepcopy__c             C   sB  t | ƒ tjjj| ƒ | jjdkrL| jƒ jƒ | j	t
| jƒ| jf}tjj|fS | j�r
| jƒ tjkrxtj| jƒ | jƒ f}n\| jƒ tjkrÂtjdd„ | jƒ jdƒD ƒdd„ | jƒ jdƒD ƒ| jƒ f}ntdj| jƒ ƒƒ‚| jƒ | jƒ t| jƒ ƒ| jƒ || jtƒ f}tjj |fS | jƒ | jƒ t| jƒ ƒ| jƒ | jtƒ f}tjj!|fS d S )	Nr   c             S   s   g | ]}|j ƒ ‘qS r-   )Úitem)Ú.0Úer-   r-   r.   ú
<listcomp>V   s    z(Tensor.__reduce_ex__.<locals>.<listcomp>é   c             S   s   g | ]}|j ƒ ‘qS r-   )r/   )r0   r1   r-   r-   r.   r2   W   s    z5Serialization is not supported for tensors of type {}éÿÿÿÿr4   )"r   r   ÚutilsÚhooksZwarn_if_has_hooksr   r   ÚcpuÚnumpyÚdtypeÚstrr%   r    Z_rebuild_xla_tensorr   r   r   r   r   r   r   Zreshaper   r   r   r   r   r"   Útupler#   r$   r   r!   Z_rebuild_tensor_v2)r)   ÚprotoÚargsr,   r-   r-   r.   Ú__reduce_ex__8   sD    


zTensor.__reduce_ex__c             C   sf   | j stdƒ‚t|ƒdkr(| j|Ž  d S t|ƒdkrT|d | _|d |d |d f}|\| _}| _d S )Nz/__setstate__ can be only called on leaf Tensorsé   é   r   é   é   )r   r   Úlenr(   Údatar%   r&   )r)   ÚstateÚ_r-   r-   r.   Ú__setstate__l   s    

zTensor.__setstate__c             C   sV   t jdkrtjj| ƒS tt jdƒr>tjj| ƒjt jjp8ddƒS tjj| ƒjddƒS d S )NrA   ÚencodingzUTF-8Úreplace)rA   )	ÚsysÚversion_infor   Z_tensor_strÚ_strÚhasattrÚstdoutÚencoderH   )r)   r-   r-   r.   Ú__repr__}   s    
zTensor.__repr__NFc             C   s   t jj| |||ƒ dS )a  Computes the gradient of current tensor w.r.t. graph leaves.

        The graph is differentiated using the chain rule. If the tensor is
        non-scalar (i.e. its data has more than one element) and requires
        gradient, the function additionally requires specifying ``gradient``.
        It should be a tensor of matching type and location, that contains
        the gradient of the differentiated function w.r.t. ``self``.

        This function accumulates gradients in the leaves - you might need to
        zero them before calling it.

        Arguments:
            gradient (Tensor or None): Gradient w.r.t. the
                tensor. If it is a tensor, it will be automatically converted
                to a Tensor that does not require grad unless ``create_graph`` is True.
                None values can be specified for scalar Tensors or ones that
                don't require grad. If a None value would be acceptable then
                this argument is optional.
            retain_graph (bool, optional): If ``False``, the graph used to compute
                the grads will be freed. Note that in nearly all cases setting
                this option to True is not needed and often can be worked around
                in a much more efficient way. Defaults to the value of
                ``create_graph``.
            create_graph (bool, optional): If ``True``, graph of the derivative will
                be constructed, allowing to compute higher order derivative
                products. Defaults to ``False``.
        N)r   ZautogradÚbackward)r)   ZgradientZretain_graphZcreate_graphr-   r-   r.   rQ   Š   s    zTensor.backwardc             C   sR   | j stdƒ‚| jdkr6tƒ | _| jdk	r6| jj| ƒ tj| jƒ}|| j|j< |S )ar  Registers a backward hook.

        The hook will be called every time a gradient with respect to the
        Tensor is computed. The hook should have the following signature::

            hook(grad) -> Tensor or None


        The hook should not modify its argument, but it can optionally return
        a new gradient which will be used in place of :attr:`grad`.

        This function returns a handle with a method ``handle.remove()``
        that removes the hook from the module.

        Example::

            >>> v = torch.tensor([0., 0., 0.], requires_grad=True)
            >>> h = v.register_hook(lambda grad: grad * 2)  # double the gradient
            >>> v.backward(torch.tensor([1., 2., 3.]))
            >>> v.grad

             2
             4
             6
            [torch.FloatTensor of size (3,)]

            >>> h.remove()  # removes the hook
        z@cannot register a hook on a tensor that doesn't require gradientN)	r%   r   r&   r   Úgrad_fnZ_register_hook_dictr6   ZRemovableHandler   )r)   ÚhookÚhandler-   r-   r.   Úregister_hook¨   s    

zTensor.register_hookc             C   s   dd„ }t |dƒƒ‚d S )Nc             S   s   dj dd„ | jdƒD ƒƒS )NÚ
c             S   s   g | ]}|j ƒ ‘qS r-   )Ústrip)r0   Úliner-   r-   r.   r2   Ò   s    z2Tensor.reinforce.<locals>.trim.<locals>.<listcomp>)ÚjoinÚsplit)r:   r-   r-   r.   ÚtrimÑ   s    zTensor.reinforce.<locals>.trimaÙ  reinforce() was removed.
            Use torch.distributions instead.
            See https://pytorch.org/docs/master/distributions.html

            Instead of:

            probs = policy_network(state)
            action = probs.multinomial()
            next_state, reward = env.step(action)
            action.reinforce(reward)
            action.backward()

            Use:

            probs = policy_network(state)
            # NOTE: categorical is equivalent to what used to be called multinomial
            m = torch.distributions.Categorical(probs)
            action = m.sample()
            next_state, reward = env.step(action)
            loss = -m.log_prob(action) * reward
            loss.backward()
        )r   )r)   Zrewardr[   r-   r-   r.   Ú	reinforceÐ   s    zTensor.reinforceaI  
    Returns a new Tensor, detached from the current graph.

    The result will never require gradient.

    .. note::

      Returned Tensor shares the same storage with the original one.
      In-place modifications on either of them will be seen, and may trigger
      errors in correctness checks.
      IMPORTANT NOTE: Previously, in-place size / stride / storage changes
      (such as `resize_` / `resize_as_` / `set_` / `transpose_`) to the returned tensor
      also update the original tensor. Now, these in-place changes will not update the
      original tensor anymore, and will instead trigger an error.
      For sparse tensors:
      In-place indices / values changes (such as `zero_` / `copy_` / `add_`) to the
      returned tensor will not update the original tensor anymore, and will instead
      trigger an error.
    zv
    Detaches the Tensor from the graph that created it, making it a leaf.
    Views cannot be detached in-place.
    c                sT   | j dkrdS | jstdƒ‚t| dƒr*dS tj| ƒ‰ ‡ fdd„}| j|ƒ d| _dS )z-Enables .grad attribute for non-leaf Tensors.Nz8can't retain_grad on Tensor that has requires_grad=FalseÚretains_gradc                s8   ˆ ƒ }|d krd S |j d kr(| jƒ |_ n|j |  |_ d S )N)Z_gradr   )ZgradÚvar)Ú	weak_selfr-   r.   Úretain_grad_hook  s    
z,Tensor.retain_grad.<locals>.retain_grad_hookT)rR   r%   r   rM   ÚweakrefÚrefrU   r]   )r)   r`   r-   )r_   r.   Úretain_grad  s    


	
zTensor.retain_gradc             C   s   | j ƒ jƒ S )zaChecks if tensor is in shared memory.

        This is always ``True`` for CUDA tensors.
        )r   Ú	is_shared)r)   r-   r-   r.   rd     s    zTensor.is_sharedc             C   s   | j ƒ jƒ  | S )zÐMoves the underlying storage to shared memory.

        This is a no-op if the underlying storage is already in shared memory
        and for CUDA tensors. Tensors in shared memory cannot be resized.
        )r   Úshare_memory_)r)   r-   r-   r.   re   !  s    zTensor.share_memory_c             C   s   | j ƒ dkr| S | jdƒS dS )z&Reverses the tensor along dimension 0.r   N)ÚdimZflip)r)   r-   r-   r.   Ú__reversed__*  s    zTensor.__reversed__Úfroc             C   s   t j| ||||d�S )zSee :func:`torch.norm`)r9   )r   Únorm)r)   Úprf   Zkeepdimr9   r-   r-   r.   ri   1  s    zTensor.normTc             C   s2   t j| || d�\}}}|r&|||fS ||fS dS )zSee :func:`torch.lu`)ÚpivotZcheck_errorsN)r   Z_lu_with_info)r)   rk   Z	get_infosZLUZpivotsZinfosr-   r-   r.   Úlu5  s    
z	Tensor.luÚreflectc	       	   
   C   s   t j| ||||||||ƒ	S )zËSee :func:`torch.stft`

        .. warning::
          This function changed signature at version 0.4.1. Calling with
          the previous signature may cause error or return incorrect result.
        )r   Ústft)	r)   Zn_fftZ
hop_lengthZ
win_lengthZwindowÚcenterZpad_modeÚ
normalizedZonesidedr-   r-   r.   rn   >  s    zTensor.stftc             G   s"   t jdƒ ddlm} |j| |ƒS )Nz non-inplace resize is deprecatedr   )ÚResize)ÚwarningsÚwarnÚtorch.autograd._functionsrq   Úapply)r)   Úsizesrq   r-   r-   r.   ÚresizeI  s    
zTensor.resizec             C   s&   t jdƒ ddlm} |j| |jƒ ƒS )Nz#non-inplace resize_as is deprecatedr   )rq   )rr   rs   rt   rq   ru   r#   )r)   Ztensorrq   r-   r-   r.   Ú	resize_asN  s    
zTensor.resize_asr   c                s2   t |tƒrtt| ƒj||ƒS tt| ƒj||ƒS dS )z See :func:`torch.split`
        N)Ú
isinstanceÚintÚsuperr
   rZ   Zsplit_with_sizes)r)   Z
split_sizerf   )Ú	__class__r-   r.   rZ   S  s    
zTensor.splitc             C   s   t j| ||||d�S )z[Returns the unique elements of the input tensor.

        See :func:`torch.unique`
        )ÚsortedÚreturn_inverseÚreturn_countsrf   )r   Úunique)r)   r}   r~   r   rf   r-   r-   r.   r€   [  s    zTensor.uniquec             C   s   t j| |||d�S )z�Eliminates all but the first element from every consecutive group of equivalent elements.

        See :func:`torch.unique_consecutive`
        )r~   r   rf   )r   Úunique_consecutive)r)   r~   r   rf   r-   r-   r.   r�   b  s    zTensor.unique_consecutivec             C   s   t jj| |ƒS )N)Ú_CZ_VariableFunctionsZrsub)r)   Úotherr-   r-   r.   Ú__rsub__i  s    zTensor.__rsub__c             C   s.   | j jr| jƒ | S | jƒ jƒ | j| ƒS d S )N)r9   Úis_floating_pointZ
reciprocalÚdoubleZtype_as)r)   rƒ   r-   r-   r.   Ú__rdiv__l  s    zTensor.__rdiv__c             C   s&   | j ƒ dkr| jƒ j|ƒS tj| |ƒS )Nr   )rf   r/   Ú
__format__Úobject)r)   Úformat_specr-   r-   r.   rˆ   w  s    zTensor.__format__c             C   s   t dƒ‚d S )Nzin-place pow not implemented)ÚNotImplementedError)r)   rƒ   r-   r-   r.   Ú__ipow__|  s    zTensor.__ipow__c             C   s   | j |ƒ|  S )N)r+   )r)   rƒ   r-   r-   r.   Ú__rpow__  s    zTensor.__rpow__c             C   s   | | }|j jr|jƒ }|S )N)r9   r…   Útrunc)r)   rƒ   Úresultr-   r-   r.   Ú__floordiv__‚  s    zTensor.__floordiv__c             C   s   ||  }|j jr|jƒ }|S )N)r9   r…   rŽ   )r)   rƒ   r�   r-   r-   r.   Ú__rfloordiv__ˆ  s    zTensor.__rfloordiv__c             C   s   | j ƒ dkrtdƒ‚| jd S )Nr   zlen() of a 0-d tensor)rf   Ú	TypeErrorÚshape)r)   r-   r-   r.   Ú__len__˜  s    zTensor.__len__c                sL   ˆ j ƒ dkrtdƒ‚tjjƒ r,tjdtd� tt	‡ fdd„t
ˆ jdƒƒƒƒS )Nr   ziteration over a 0-d tensorzÐIterating over a tensor might cause the trace to be incorrect. Passing a tensor of different shape won't change the number of iterations executed (and might lead to errors or silently give incorrect results).)Úcategoryc                s   ˆ |  S )Nr-   )Úi)r)   r-   r.   Ú<lambda>«  s    z!Tensor.__iter__.<locals>.<lambda>)rf   r’   r   r‚   Z_get_tracing_staterr   rs   ÚRuntimeWarningÚiterr   Úranger#   )r)   r-   )r)   r.   Ú__iter__�  s    
zTensor.__iter__c             C   s   t | ƒS )N)r   )r)   r-   r-   r.   Ú__hash__­  s    zTensor.__hash__c             C   sJ   t | jƒ}|jdƒ t| jjƒ ƒ}|| }| j s8| jrB|jdƒ t|ƒS )NZvolatileÚ__cuda_array_interface__)	Údirr|   ÚremoveÚlistÚ__dict__ÚkeysÚis_cudar   r}   )r)   Ztensor_methodsÚattrsr¢   r-   r-   r.   Ú__dir__°  s    


zTensor.__dir__iè  c             C   s&   |d kr| j ƒ S | j ƒ j|dd�S d S )NF)Úcopy)r8   Úastype)r)   r9   r-   r-   r.   Ú	__array__¿  s    zTensor.__array__c             C   s   |j tkr|jdƒ}tj|ƒS )NÚuint8)r9   Úboolr§   r   Z
from_numpy)r)   Úarrayr-   r-   r.   Ú__array_wrap__Ç  s    

zTensor.__array_wrap__c             C   s4   t |tjtfƒr || kjƒ jƒ S tdt|ƒ ƒ‚dS )z²Check if `element` is present in tensor

        Arguments:
            element (Tensor or scalar): element to be checked
                for presence in current tensor"
        zKTensor.__contains__ only supports Tensor or scalar, but you passed in a %s.N)ry   r   r
   r	   Úanyr/   r   r   )r)   Úelementr-   r-   r.   Ú__contains__Í  s
    zTensor.__contains__c                sÂ   | j std| jƒ  ƒ‚| jr,td| jƒ  ƒ‚| jr:tdƒ‚tjdtjdtj	dtj
dtjdtjd	tjd
tjdi| j }| jƒ jƒ ‰ t| jƒ}t‡ fdd„| jƒ D ƒƒ}| jƒ df}t||||dd�S )z�Array view description for cuda tensors.

        See:
        https://numba.pydata.org/numba-doc/latest/cuda/cuda_array_interface.html
        zŠCan't get __cuda_array_interface__ on non-CUDA tensor type: %s If CUDA data is required use tensor.cuda() to copy tensor to device memory.zoCan't get __cuda_array_interface__ on sparse type: %s Use Tensor.to_dense() to convert to a dense tensor first.zœCan't get __cuda_array_interface__ on Variable that requires grad. If gradients aren't required, use var.detach() to get Variable that doesn't require grad.z<f2z<f4z<f8z|u1z|i1z<i2z<i4z<i8c             3   s   | ]}|ˆ  V  qd S )Nr-   )r0   Ús)Úitemsizer-   r.   ú	<genexpr>  s    z2Tensor.__cuda_array_interface__.<locals>.<genexpr>Fr3   )Útypestrr“   ÚstridesrD   Úversion)r£   ÚAttributeErrorr   r   r%   r   r   Zfloat16Zfloat32Zfloat64r©   Zint8Zint16Zint32Zint64r9   r   Zelement_sizer;   r“   r$   Zdata_ptrÚdict)r)   r³   r“   r´   rD   r-   )r±   r.   r�   Ü  s2    

zTensor.__cuda_array_interface__c                s   t || jdƒ}tt| ƒj|ƒS )aË  Refines the dimension names of :attr:`self` according to :attr:`names`.

        Refining is a special case of renaming that "lifts" unnamed dimensions.
        A ``None`` dim can be refined to have any name; a named dim can only be
        refined to have the same name.

        Because named tensors can coexist with unnamed tensors, refining names
        gives a nice way to write named-tensor-aware code that works with both
        named and unnamed tensors.

        :attr:`names` may contain up to one Ellipsis (``...``).
        The Ellipsis is expanded greedily; it is expanded in-place to fill
        :attr:`names` to the same length as ``self.dim()`` using names from the
        corresponding indices of ``self.names``.

        Python 2 does not support Ellipsis but one may use a string literal
        instead (``'...'``).

        Arguments:
            names (iterable of str): The desired names of the output tensor. May
                contain up to one Ellipsis.

        Examples::

            >>> imgs = torch.randn(32, 3, 128, 128)
            >>> named_imgs = imgs.refine_names('N', 'C', 'H', 'W')
            >>> named_imgs.names
            ('N', 'C', 'H', 'W')

            >>> tensor = torch.randn(2, 3, 5, 7, 11)
            >>> tensor = tensor.refine_names('A', ..., 'B', 'C')
            >>> tensor.names
            ('A', None, None, 'B', 'C')

        .. warning::
            The named tensor API is experimental and subject to change.

        Úrefine_names)r   Únamesr{   r
   r¸   )r)   r¹   )r|   r-   r.   r¸     s    'zTensor.refine_namesc                s   t t| ƒjt|| jddd�ƒS )aõ  Permutes the dimensions of the :attr:`self` tensor to match the order
        specified in :attr:`names`, adding size-one dims for any new names.

        All of the dims of :attr:`self` must be named in order to use this method.
        The resulting tensor is a view on the original tensor.

        All dimension names of :attr:`self` must be present in :attr:`names`.
        :attr:`names` may contain additional names that are not in ``self.names``;
        the output tensor has a size-one dimension for each of those new names.

        :attr:`names` may contain up to one Ellipsis (``...``).
        The Ellipsis is expanded to be equal to all dimension names of :attr:`self`
        that are not mentioned in :attr:`names`, in the order that they appear
        in :attr:`self`.

        Python 2 does not support Ellipsis but one may use a string literal
        instead (``'...'``).

        Arguments:
            names (iterable of str): The desired dimension ordering of the
                output tensor. May contain up to one Ellipsis that is expanded
                to all unmentioned dim names of :attr:`self`.

        Examples::

            >>> tensor = torch.randn(2, 2, 2, 2, 2, 2)
            >>> named_tensor = tensor.refine_names('A', 'B', 'C', 'D', 'E', 'F')

            # Move the F and E dims to the front while keeping the rest in order
            >>> named_tensor.align_to('F', 'E', ...)

        .. warning::
            The named tensor API is experimental and subject to change.

        Úalign_toF)Zis_positional)r{   r
   rº   r   r¹   )r)   r¹   )r|   r-   r.   rº   :  s    $
zTensor.align_toc                s    t |ƒ\}}tt| ƒj|||ƒS )aU  Unflattens the named dimension :attr:`dim`, viewing it in the shape
        specified by :attr:`namedshape`.

        Arguments:
            namedshape: (iterable of ``(name, size)`` tuples).

        Examples::

            >>> flat_imgs = torch.rand(32, 3 * 128 * 128, names=('N', 'features'))
            >>> imgs = flat_imgs.unflatten('features', (('C', 3), ('H', 128), ('W', 128)))
            >>> imgs.names, images.shape
            (('N', 'C', 'H', 'W'), torch.Size([32, 3, 128, 128]))

        .. warning::
            The named tensor API is experimental and subject to change.

        )r   r{   r
   Ú	unflatten)r)   rf   Z
namedshaper¹   rv   )r|   r-   r.   r»   a  s    zTensor.unflattenc             O   s   t | ||dd�S )z+In-place version of :meth:`~Tensor.rename`.T)Úinplace)r   )r)   r¹   Ú
rename_mapr-   r-   r.   Úrename_v  s    zTensor.rename_c             O   s   t | ||dd�S )am  Renames dimension names of :attr:`self`.

        There are two main usages:

        ``self.rename(**rename_map)`` returns a view on tensor that has dims
        renamed as specified in the mapping :attr:`rename_map`.

        ``self.rename(*names)`` returns a view on tensor, renaming all
        dimensions positionally using :attr:`names`.
        Use ``self.rename(None)`` to drop names on a tensor.

        One cannot specify both positional args :attr:`names` and keyword args
        :attr:`rename_map`.

        Examples::

            >>> imgs = torch.rand(2, 3, 5, 7, names=('N', 'C', 'H', 'W'))
            >>> renamed_imgs = imgs.rename(N='batch', C='channels')
            >>> renamed_imgs.names
            ('batch', 'channels', 'H', 'W')

            >>> renamed_imgs = imgs.rename(None)
            >>> renamed_imgs.names
            (None,)

            >>> renamed_imgs = imgs.rename('batch', 'channel', 'height', 'width')
            >>> renamed_imgs.names
            ('batch', 'channel', 'height', 'width')

        .. warning::
            The named tensor API is experimental and subject to change.

        F)r¼   )r   )r)   r¹   r½   r-   r-   r.   Úrename€  s    #zTensor.renamec                s(   |rt t| ƒj|ƒS t t| ƒj|ƒS d S )N)r{   r
   r¾   r¿   )r)   r¹   r¼   )r|   r-   r.   Ú_update_names¥  s    zTensor._update_namesr   )NNF)rh   NFN)TF)NNNTrm   FT)r   )TFFN)FFN)N)HÚ__name__Ú
__module__Ú__qualname__r   r>   rG   rP   rQ   rU   r\   r   r‚   Ú_TensorBaseÚdetachZdetach_rc   rd   re   rg   ri   rl   rn   rw   rx   rZ   r€   r�   r„   r‡   Ú__rtruediv__Z__idiv__Ú__itruediv__ÚpowÚ__pow__rˆ   rŒ   r�   r�   r‘   ÚnegÚ__neg__ÚeqÚ__eq__ÚneÚ__ne__ÚltÚ__lt__ÚleÚ__le__ÚgtÚ__gt__ÚgeÚ__ge__ÚabsÚ__abs__r”   r›   rœ   r¥   Z__array_priority__r¨   r¬   r¯   Úpropertyr�   r¸   rº   r»   r¾   r¿   rÀ   Ú__classcell__r-   r-   )r|   r.   r
      st   !4
(	

	 




4*'
%r
   )rJ   r   Ztorch._Cr‚   Ztorch._namedtensor_internalsr   r   r   r   Úcollectionsr   Ztorch.utils.hooksr5   r6   rr   ra   Z
torch._sixr   r   Znumbersr	   rÄ   r
   r-   r-   r-   r.   Ú<module>   s   

