ó
àÆ÷Xc           @` s‚   d  Z  d d l m Z m Z m Z d d l Z d d l m Z d d l Z	 d d l
 m Z d d l Z d d l j Z d „  Z d S(   s,   
This test is for testing the NanGuardMode.
i    (   t   absolute_importt   print_functiont   divisionN(   t   assert_raises(   t   NanGuardModec    	   	   C` sé  t  j ƒ  }  t j t j j d d ƒ j t j j	 ƒ ƒ } t  j
 |  | ƒ } t j |  g | d t d t d t ƒ ƒ} t j j d d ƒ j t j j	 ƒ } t j t j d ƒ d j t j j	 ƒ d ƒ } t j t j t j ƒ j t j j	 ƒ d ƒ } t j t j d	 ƒ j t j j	 ƒ d ƒ } | | ƒ t j d
 ƒ } z= t | _ t t | | ƒ t t | | ƒ t t | | ƒ Wd  t | _ Xt j j d d d ƒ j t j j	 ƒ } t j t j d ƒ d j t j j	 ƒ d ƒ } t j t j t j ƒ j t j j	 ƒ d ƒ } t j t j d	 ƒ j t j j	 ƒ d ƒ } t  j ƒ  }  |  d  d  … t  j d ƒ t  j d ƒ d  f } t j |  g | d t d t d t ƒ ƒ} | | ƒ z= t | _ t t | | ƒ t t | | ƒ t t | | ƒ Wd  t | _ Xd  S(   Ni   i   t   modet   nan_is_errort   inf_is_errori   g      Y@i@B g@Œµx¯Ds   theano.compile.nanguardmodei   i   (   i   i   (   i   i   (   i   i   (   i   i   i   (   i   i   i   (   i   i   i   (   t   Tt   matrixt   theanot   sharedt   npt   randomt   randnt   astypet   configt   floatXt   dott   functionR   t   Truet   tilet   asarrayt   nant   loggingt	   getLoggert   Falset	   propagateR   t   AssertionErrort   tensor3t   aranget   None(	   t   xt   wt   yt   funt   at   infat   nanat   bigat   _logger(    (    sF   /tmp/pip-build-X4mzal/theano/theano/compile/tests/test_nanguardmode.pyt   test_NanGuardMode   sR    -$('$
	
'	'$.
	(   t   __doc__t
   __future__R    R   R   R   t
   nose.toolsR   t   numpyR   t   theano.compile.nanguardmodeR   R
   t   theano.tensort   tensorR   R)   (    (    (    sF   /tmp/pip-build-X4mzal/theano/theano/compile/tests/test_nanguardmode.pyt   <module>   s   