Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
opt
/
alt
/
python35
/
lib64
/
python3.5
/
site-packages
/
numpy
/
lib
/
__pycache__
/
File Content:
stride_tricks.cpython-35.opt-1.pyc
W��f� � @ s� d Z d d l m Z m Z m Z d d l Z d d g Z Gd d � d e � Z d d � Z d d d d d � Z d d � Z d d d � Z d d � Z d d � Z d S)z� Utilities that manipulate strides to achieve desirable effects. An explanation of strides can be found in the "ndarray.rst" file in the NumPy reference guide. � )�division�absolute_import�print_functionN�broadcast_to�broadcast_arraysc @ s% e Z d Z d Z d d d � Z d S)� DummyArrayz�Dummy object that just exists to hang __array_interface__ dictionaries and possibly keep alive a reference to a base array. Nc C s | | _ | | _ d S)N)�__array_interface__�base)�self� interfacer � r �/stride_tricks.py�__init__ s zDummyArray.__init__)�__name__� __module__�__qualname__�__doc__r r r r r r s r c C sJ t | � t | � k rF | j d t | � � } | j rF | j | � | S)N�type)r �viewZ__array_finalize__)Zoriginal_arrayZ new_arrayr r r �_maybe_view_as_subclass s r Fc C s� t j | d d d | �} t | j � } | d k rF t | � | d <| d k rb t | � | d <t j t | d | �� } | j j d k r� | j j d k r� | j | _ t | | � S)zL Make an ndarray from the given array with the given shape and strides. �copyF�subokN�shape�stridesr ) �np�array�dictr �tupleZasarrayr ZdtypeZfieldsr )�xr r r r r r r r � as_strided&