ó
àÆ÷Xc           @` s¾   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 d l m Z m Z m Z d  d l m Z d e e f d „  ƒ  YZ d	 e f d
 „  ƒ  YZ d S(   i    (   t   absolute_importt   print_functiont   divisionN(   t   ScipyGeri   (   t   TestCaset   gemm_no_inplacet   TestBlasStrides(   t   TestOptimizationMixint   TestScipyGerc           B` sP   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   c         C` s8  t  j j ƒ  |  _ |  j j d ƒ |  _ |  j j d ƒ |  _ d } |  _ t j d | d t t f ƒ |  _	 t j d | d d ƒ |  _
 t j d | d t f ƒ |  _ t j d | d t f ƒ |  _ t j d d | ƒ|  _ t j d d g d | ƒ|  _ t j d	 d
 d g d | ƒ|  _ t  j j j s4|  j ƒ  n  d  S(   Nt   fast_runt   c_blast   float64t   dtypet   broadcastablei   i   i   g      ø?gš™™™™™@g333333@(    (   i   i   (   t   theanot   compilet   get_default_modet   modet	   includingt	   excludingR   t   tensort   Falset   At   at   xt   yt   numpyt   onest   Avalt   asarrayt   xvalt   yvalt
   blas_scipyt
   have_fblast   SkipTest(   t   selfR   (    (    sC   /tmp/pip-build-X4mzal/theano/theano/tensor/tests/test_blas_scipy.pyt   setUp   s    !!c         C` s   t  j | | |  j ƒ S(   N(   R   t   functionR   (   R#   t   inputst   outputs(    (    sC   /tmp/pip-build-X4mzal/theano/theano/tensor/tests/test_blas_scipy.pyR%      s    c         C` sl   | |  j  |  j |  j ƒ | |  j  d  d  d … d  d  d … f |  j d  d  d … |  j d  d  d … ƒ d  S(   Niÿÿÿÿ(   R   R   R   (   R#   t   f(    (    sC   /tmp/pip-build-X4mzal/theano/theano/tensor/tests/test_blas_scipy.pyt   run_f    s    c         C` s   t  j t j | d |  j ƒƒ S(   NR   (   R   t   as_tensor_variableR   R   R   (   R#   t   bval(    (    sC   /tmp/pip-build-X4mzal/theano/theano/tensor/tests/test_blas_scipy.pyt   b$   s    c         C` sM   |  j  |  j |  j g t j |  j |  j ƒ ƒ } |  j | t d t ƒ ƒ d  S(   Nt   destructive(   R%   R   R   R   t   outert   assertFunctionContainsR   t   True(   R#   R(   (    (    sC   /tmp/pip-build-X4mzal/theano/theano/tensor/tests/test_blas_scipy.pyt
   test_outer'   s    0c         C` sg   |  j  |  j |  j |  j g |  j t j |  j |  j ƒ ƒ } |  j | t d t ƒ ƒ |  j	 | ƒ d  S(   NR-   (
   R%   R   R   R   R   R.   R/   R   R   R)   (   R#   R(   (    (    sC   /tmp/pip-build-X4mzal/theano/theano/tensor/tests/test_blas_scipy.pyt   test_A_plus_outer+   s    "c         C` sk   |  j  |  j |  j |  j g |  j d t j |  j |  j ƒ ƒ } |  j | t d t ƒ ƒ |  j	 | ƒ d  S(   Ngš™™™™™¹?R-   (
   R%   R   R   R   R   R.   R/   R   R   R)   (   R#   R(   (    (    sC   /tmp/pip-build-X4mzal/theano/theano/tensor/tests/test_blas_scipy.pyt   test_A_plus_scaled_outer1   s    &c         C` sf   |  j  |  j |  j |  j g d |  j d t j |  j |  j ƒ ƒ } |  j | t ƒ |  j | ƒ d  S(   Ngš™™™™™É?gš™™™™™¹?(	   R%   R   R   R   R   R.   R/   R   R)   (   R#   R(   (    (    sC   /tmp/pip-build-X4mzal/theano/theano/tensor/tests/test_blas_scipy.pyt   test_scaled_A_plus_scaled_outer7   s    *(
   t   __name__t
   __module__R$   R%   R)   R,   R1   R2   R3   R4   (    (    (    sC   /tmp/pip-build-X4mzal/theano/theano/tensor/tests/test_blas_scipy.pyR      s   							t   TestBlasStridesScipyc           B` s2   e  Z e j j ƒ  Z e j d  ƒ j d d ƒ Z RS(   R	   t   gpuR
   (   R5   R6   R   R   R   R   R   R   (    (    (    sC   /tmp/pip-build-X4mzal/theano/theano/tensor/tests/test_blas_scipy.pyR7   >   s   (   t
   __future__R    R   R   t   sysR   R   t   theano.tensorR   t   theano.tensor.blas_scipyR   t	   test_blasR   R   R   t   theano.tests.unittest_toolsR   R   R7   (    (    (    sC   /tmp/pip-build-X4mzal/theano/theano/tensor/tests/test_blas_scipy.pyt   <module>   s   2