
    ci
                        d dl mZ d dlmZ d dlmc mZ ddlm	Z	m
Z
 d dlmZ ddlmZ  ed	      Zd
ee   de	e   fdZ eej$                        Z eej&                        Z eej(                        Z eej*                        Z eej,                        Z eej.                        Ze
dd       Ze
dd       Ze
dd       Zy)    )TypeVar)JITFunctionN   )GluonJITFunctionjit)knobs   )_coreTfnreturnc                     t         j                  j                  st        | t              sJ t        | j                        }| j                  |_        |S N)r   runtime	interpret
isinstancer   r   r   __doc__)r   gluon_fns     f/var/www/html/engine/venv/lib/python3.12/site-packages/triton/experimental/gluon/language/_standard.py_import_from_tritonr      s<    ==""j[&AAA255zHzzHO    c                 2    t        j                  | d||      S )aV  
    Create a tensor filled with zeros.

    Args:
        shape (Sequence[int]): The shape of the tensor.
        dtype (dtype): The data type for the tensor.
        layout (Optional[DistributedLayout]): The distributed layout of the tensor, defaults to AutoLayout().

    Returns:
        tensor: A tensor where every element is zero.
    r   )ttglfullshapedtypelayouts      r   zerosr      s     99UAuf--r   c                     t        j                  || j                  n|||| j                  n||| j                  j
                        S |      S )a-  
    Create a tensor with the same properties as a given tensor, filled with a specified value.

    Args:
        input (tensor): Reference tensor to infer default shape, dtype, and layout.
        value (int or float): The fill value.
        shape (Sequence[int], optional): Target shape. Defaults to input.shape.
        dtype (dtype, optional): Target data type. Defaults to input.dtype.
        layout (DistributedLayout, optional): Target layout. Defaults to input.layout.

    Returns:
        tensor: A tensor where every element equals value.
    )r   r   r   r   typer   )inputvaluer   r   r   s        r   	full_liker$   +   sR     99}%}%#^

	  28	 r   c                 "    t        | d|||      S )a  
    Create a tensor with the same properties as a given tensor, filled with zeros.

    Args:
        input (tensor): Reference tensor to infer default shape, dtype, and layout.
        shape (Sequence[int], optional): Target shape. Defaults to input.shape.
        dtype (dtype, optional): Target data type. Defaults to input.dtype.
        layout (DistributedLayout, optional): Target layout. Defaults to input.layout.

    Returns:
        tensor: A tensor where every element is zero.
    r   r   )r$   )r"   r   r   r   s       r   
zeros_liker&   B   s     UAU%GGr   r   )NNN)typingr   triton.runtime.jitr   triton.language.standardlanguagestandardtl_standard_runtimer   r   tritonr    r
   r   r   r   cdivsummaxmin	reduce_orxor_sumr   r$   r&    r   r   <module>r7      s     * . . ,  CLKN /?/B  ;++,+//*+//*+//* 5 56	
k11
2 . .  , H Hr   