o
    iN                     @   sD   d Z ddlZddlmZ ddlZeejdejdejfddZdS )
    N)wrapstensorreturnc                 K   s   t j| fi i |ddi}|   }dkr:tjd|tjtjB d}t j|t jd}|	| d|j
|  ||dd |S )Nrequires_gradFr   )prot)dtype)torch
empty_likeuntyped_storagenbytesmmap	PROT_READ
PROT_WRITE
frombufferuint8set_shapestriderequires_grad_get)r   kwargsemptyr   buffer r   K/home/ubuntu/.local/lib/python3.10/site-packages/spaces/zero/torch/utils.pyempty_like_raw_alloc
   s   r   )__doc__r   	functoolsr   r
   r   Tensorr   r   r   r   r   <module>   s    