ó
™^c           @   s3   d a d  e f d „  ƒ  YZ d d d „  ƒ  YZ d S(   t   InstructionStreamc           B   sS   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d d „ Z	 RS(	   c         C   s   t  ƒ  |  _ d  |  _ d  S(   N(   t   listt   instructionst   Nonet   previous_stream(   t   self(    (    s;   /torch/pytorch/third_party/python-peachpy/peachpy/stream.pyt   __init__   s    c         C   s   t  |  _ |  a  |  S(   N(   t   active_streamR   (   R   (    (    s;   /torch/pytorch/third_party/python-peachpy/peachpy/stream.pyt	   __enter__   s    	c         C   s   |  j  a d  |  _  d  S(   N(   R   R   R   (   R   t   exc_typet	   exc_valuet	   traceback(    (    s;   /torch/pytorch/third_party/python-peachpy/peachpy/stream.pyt   __exit__   s    	c         C   s   t  |  j ƒ S(   N(   t   iterR   (   R   (    (    s;   /torch/pytorch/third_party/python-peachpy/peachpy/stream.pyt   __iter__   s    c         C   s   t  |  j ƒ S(   N(   t   lenR   (   R   (    (    s;   /torch/pytorch/third_party/python-peachpy/peachpy/stream.pyt   __len__   s    c         C   s(   y |  j  | SWn t k
 r# d  SXd  S(   N(   R   t
   IndexErrorR   (   R   t   i(    (    s;   /torch/pytorch/third_party/python-peachpy/peachpy/stream.pyt   __getitem__   s    c         C   s#   | d  k	 r |  j j | ƒ n  d  S(   N(   R   R   t   append(   R   t   instruction(    (    s;   /torch/pytorch/third_party/python-peachpy/peachpy/stream.pyt   add_instruction#   s    i   c         C   s@   x9 t  | ƒ D]+ } |  j r t j |  j j d ƒ ƒ q q Wd  S(   Ni    (   t   rangeR   R   R   t   pop(   R   t   countR   (    (    s;   /torch/pytorch/third_party/python-peachpy/peachpy/stream.pyt   issue'   s    	(
   t   __name__t
   __module__R   R   R   R   R   R   R   R   (    (    (    s;   /torch/pytorch/third_party/python-peachpy/peachpy/stream.pyR       s   							t
   NullStreamc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s   d  |  _ d  S(   N(   R   R   (   R   (    (    s;   /torch/pytorch/third_party/python-peachpy/peachpy/stream.pyR   .   s    c         C   s   t  |  _ d  a  |  S(   N(   R   R   R   (   R   (    (    s;   /torch/pytorch/third_party/python-peachpy/peachpy/stream.pyR   1   s    	c         C   s   |  j  a d  |  _  d  S(   N(   R   R   R   (   R   R	   R
   R   (    (    s;   /torch/pytorch/third_party/python-peachpy/peachpy/stream.pyR   7   s    	(   R   R   R   R   R   (    (    (    s;   /torch/pytorch/third_party/python-peachpy/peachpy/stream.pyR   -   s   		N(    (   R   R   t   objectR    R   (    (    (    s;   /torch/pytorch/third_party/python-peachpy/peachpy/stream.pyt   <module>   s   &