
    3j              	           S SK r S SKJr  S
S\S\ R                  S\S\ R                  4S jjrS
S\S\ R                  S\S\ R                  4S	 jjrg)    N)KORNIA_CHECKninputshared_memoryreturnc                 n   [        U S:  SU  35        [        [        UR                  5      S:  SUR                   35        [        R                  " XR
                  UR                  S9nU(       a"  US   R                  UR                  S   X 5      $ US   R                  UR                  S   SS5      $ )a  Return a 2-D tensor with ones on the diagonal and zeros elsewhere with the same batch size as the input.

Args:
    n: the number of rows :math:`(N)`.
    input: image tensor that will determine the batch size of the output matrix.
      The expected shape is :math:`(B, *)`.
    shared_memory: when set, all samples in the batch will share the same memory.

Returns:
   The identity matrix with the same batch size as the input :math:`(B, N, N)`.

Notes:
    When the dimension to expand is of size 1, using torch.expand(...) yields the same tensor as torch.repeat(...)
    without using extra memory. Thus, when the tensor obtained by this method will be later assigned -
    use this method with shared_memory=False, otherwise, prefer using it with shared_memory=True.

r   n must be positive. Got:    z1input must have at least 1 dimension. Got shape: devicedtypeN)	r   lenshapetorcheyer   r   expandrepeat)r   r   r   identitys       I/home/wildlama/miniconda3/lib/python3.13/site-packages/kornia/core/ops.pyeye_liker      s    $ Q3A378U[[!Q&*[\a\g\g[h(ij yy<<u{{CH:G8D>  Q6xXVZ^MbMbchcncnopcqstvwMxx    tensorc                 t   [        U S:  SU  35        [        [        UR                  5      S:  SUR                   35        [        R                  " U SUR
                  UR                  S9nU(       a#  US   R                  UR                  S   U S5      $ US   R                  UR                  S   SS5      $ )a  Return a 2-D tensor with a vector containing zeros with the same batch size as the input.

Args:
    n: the number of rows :math:`(N)`.
    tensor: image tensor that will determine the batch size of the output matrix.
      The expected shape is :math:`(B, *)`.
    shared_memory: when set, all samples in the batch will share the same memory.

Returns:
    The vector with the same batch size as the input :math:`(B, N, 1)`.

Notes:
    When the dimension to expand is of size 1, using torch.expand(...) yields the same tensor as torch.repeat(...)
    without using extra memory. Thus, when the tensor obtained by this method will be later assigned -
    use this method with shared_memory=False, otherwise, prefer using it with shared_memory=True.

r   r	   r
   z2tensor must have at least 1 dimension. Got shape: r   N)	r   r   r   r   zerosr   r   r   r   )r   r   r   vecs       r   vec_liker   2   s    $ Q3A378V\\"a'+]^d^j^j]k)lm
++a6==
EC6C3t9FLLOQ2pTIYIYZ`ZfZfghZiklnoIppr   )F)r   kornia.core.checkr   intTensorboolr   r    r   r   <module>r"      si   $  *y yELL y y%,, y6q qU\\ q$ q5<< qr   