Current File : //usr/lib64/python2.7/site-packages/numpy/lib/tests/test_stride_tricks.pyc |
�
E�`Qc @ s� d d l Z d d l Td d l m Z d � Z d � Z e e d � Z d � Z d � Z
d � Z d
� Z d � Z
d � Z d
� Z e d k r� e � n d S( i����N( t *( t broadcast_arraysc C sn g | D] } t j | � ^ q } t | � } g | D] } | j ^ q5 } | g t | � } t | | � d S( sc Broadcast a list of arrays with the given input shapes and check the
common output shape.
N( t npt zerosR t shapet lent assert_equal( t input_shapest expected_shapet st inarrayst outarrayst at outshapest expected( ( sH /usr/lib64/python2.7/site-packages/numpy/lib/tests/test_stride_tricks.pyt assert_shapes_correct s
"c C s6 g | D] } t j | � ^ q } t t t | � d S( sw Broadcast a list of arrays with the given (incompatible) input shapes
and check that they raise a ValueError.
N( R R t
assert_raisest
ValueErrorR ( R R R
( ( sH /usr/lib64/python2.7/site-packages/numpy/lib/tests/test_stride_tricks.pyt assert_incompatible_shapes_raise s "c
C s� t j | d t �} t t j j | � � } t j | � j | � } | r` | j } | j } n | r� | d d d � } | d d d � } n | | } t | | � \ } } t | | � d S( s� Broadcast two shapes against each other and check that the data layout
is the same as if a ufunc did the broadcasting.
t dtypeNi����(
R R t intt multiplyt reducet aranget reshapet TR t assert_array_equal(
t shape0t shape1t
transposedt flippedt x0t nt x1t yt b0t b1( ( sH /usr/lib64/python2.7/site-packages/numpy/lib/tests/test_stride_tricks.pyt assert_same_as_ufunc s
c C sQ t j d � } t j d � } t | | � \ } } t | | � t | | � d S( Ni
( R R R R ( t xR"