ó
àÆ÷Xc           @` s´   d  Z  d d l m Z m Z m Z d d l Z d d l Z d d l Z d d l j	 Z
 d d l m Z d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ e d	 k r° e j ƒ  n  d S(
   s   
Test compilation modes
i    (   t   absolute_importt   print_functiont   divisionN(   t   Modet   T_bunch_of_modesc           B` s   e  Z d  „  Z RS(   c   
      C` s%  g  } d d d g } t  j j r? d d d d d d	 d
 g } n d d d d d g } | g  | D] } t | d ƒ ^ q^ } x† | D]~ } t j ƒ  } t j ƒ  } t  j | | g | | d | ƒ}	 |	 d d g d d g g d d g ƒ | j |	 j	 j
 j j ƒ q Wd t t | ƒ ƒ k s!t ‚ d  S(   Nt   FAST_COMPILEt   FAST_RUNt
   DEBUG_MODEt   pys   c|pys	   c|py_nogct   vmt   vm_nogct   cvmt   cvm_nogct   fast_runt   modei   i   i   i   i   i   (   t   theanot   configt   cxxR   t   Tt   matrixt   vectort   functiont   appendt   makerR   t   linkert	   __class__t   lent   sett   AssertionError(
   t   selft   linker_classes_involvedt   predef_modest   linkersR   t   modesR   t   xt   yt   f(    (    s?   /tmp/pip-build-X4mzal/theano/theano/compile/tests/test_modes.pyt   test1   s    &"%	(   t   __name__t
   __module__R%   (    (    (    s?   /tmp/pip-build-X4mzal/theano/theano/compile/tests/test_modes.pyR      s   t   T_old_problemc           B` s   e  Z d  „  Z RS(   c         C` sl   t  j j j ƒ  } | j d ƒ } t j | ƒ t  j j j ƒ  j } t | d ƒ sh | j	 d  k sh t ‚ d  S(   Nt
   specializet   fgraph(   R   t   compileR   t   get_default_modet	   includingt   copyt   deepcopyR   t   hasattrR*   t   NoneR   (   R   t   default_modet   modified_modeR   (    (    s?   /tmp/pip-build-X4mzal/theano/theano/compile/tests/test_modes.pyt   test_11   s
    (   R&   R'   R4   (    (    (    s?   /tmp/pip-build-X4mzal/theano/theano/compile/tests/test_modes.pyR(   0   s   t   __main__(   t   __doc__t
   __future__R    R   R   R.   t   unittestR   t   theano.tensort   tensorR   t   theano.compileR   t   TestCaseR   R(   R&   t   main(    (    (    s?   /tmp/pip-build-X4mzal/theano/theano/compile/tests/test_modes.pyt   <module>   s   #