Ë
    Â¯wg  ã                   ó$   — d Z ddlZddlZd„ Zd„ Zy)an  This file provides a location for operators that help exporting models via onnx.

E.g. `shape_as_tensor` and `reshape_from_tensor_shape`
are to make all dynamic sizes operations traceable.

NOTE: at one point these functions were implemented differently.
Since then we have implemented these directly in ATen, so this
file is kept purely for backward-compatibility.
é    Nc                 ó,   — t        j                  | «      S )a.  Get the shape of a tensor as a tensor.

    Args:
        x (Tensor): The input tensor.

    Returns:
        Tensor: A tensor of shape [len(x.shape)] containing the size of each dimension of x.

    Example:
        >>> x = torch.randn(2, 3)
        >>> shape_as_tensor(x)
        tensor([2, 3])

    )ÚtorchÚ_shape_as_tensor)Úxs    úY/home/mcse/projects/flask/flask-venv/lib/python3.12/site-packages/torch/onnx/operators.pyÚshape_as_tensorr      s   € ô ×!Ñ! !Ó$Ð$ó    c                 ó.   — t        j                  | |«      S )a…  Reshape a tensor to the given shape.

    This function is used to make dynamic size operations traceable when exporting models via ONNX.
    This function is kept for backward-compatibility. It is implemented directly in ATen.

    Parameters:
        x (Tensor): the tensor to be reshaped.
        shape (Tensor): the target shape.

    Returns:
        Tensor: the reshaped tensor.
    )r   Ú_reshape_from_tensor)r   Úshapes     r   Úreshape_from_tensor_shaper   "   s   € ô ×%Ñ% a¨Ó/Ð/r	   )Ú__doc__r   Ú
torch.onnxr   r   © r	   r   ú<module>r      s   ðñó Û ò%ó$0r	   