Module Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad ClassDef bases AttributeLoad NameLoad attr body Expr Str Assign NameStore NameLoad Assign NameStore TupleLoad Str Str FunctionDef arguments args NameParam NameParam NameParam defaults Str TupleLoad Num Num body If Call NameLoad NameLoad NameLoad body If CompareLt NameLoad Num body Raise Call NameLoad Call AttributeLoad Str attr NameLoad Assign NameStore TupleLoad NameLoad NameLoad If Call NameLoad NameLoad NameLoad body If BoolOpOr CompareNotEq Call NameLoad NameLoad Num CompareLt SubscriptLoad NameLoad Index Num Num CompareLt SubscriptLoad NameLoad Index Num Num body Raise Call NameLoad Call AttributeLoad Str attr NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad Assign NameStore TupleLoad NameLoad NameLoad If UnaryOpNot BoolOpOr BoolOpAnd Call NameLoad NameLoad NameLoad CompareGtE Call NameLoad NameLoad Num CompareIn NameLoad TupleLoad Str Str Str body Raise Call NameLoad Call AttributeLoad Str attr NameLoad Assign AttributeStore NameLoad attr NameLoad If CompareNotEq Call NameLoad NameLoad Num body Raise Call NameLoad Str Assign AttributeStore NameLoad attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body If CompareNotEq AttributeLoad NameLoad attr Str body Return AttributeLoad NameLoad attr Return TupleLoad Num Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return BinOpMod Str TupleLoad AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return ListLoad Str decorator_list FunctionDef arguments args NameParam defaults body Return TupleLoad Num Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Dict Assign NameStore Call NameLoad AttributeLoad SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Str Index Num attr Assert CompareIn NameLoad TupleLoad Str Str If CompareEq NameLoad Str body Assign SubscriptStore NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str Num Assign SubscriptStore NameLoad Index Str Str orelse Assign SubscriptStore NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str Num Assign SubscriptStore NameLoad Index Str Str Assign NameStore ListLoad Str Assign NameStore ListComp Call AttributeLoad Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Index Num NameLoad attr comprehension NameStore NameLoad Assign NameStore Str For NameStore NameLoad body AugAssignAdd NameStore NameLoad Return BinOpMod NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore NameStore Num orelse If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore NameStore Num orelse If Call NameLoad AttributeLoad NameLoad attr NameLoad body Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr orelse Assert CompareEq AttributeLoad NameLoad attr Str Assign NameStore NameStore Num If CompareEq NameLoad Str body Assign NameStore Num Assign NameStore NameLoad orelse If CompareEq NameLoad Str body Assign NameStore Num Assign NameStore NameLoad orelse If CompareEq NameLoad Str body Assign NameStore Num Assign NameStore NameLoad orelse Raise Call NameLoad Str If BoolOpOr BoolOpAnd CompareNotEq NameLoad Num CompareNotEq NameLoad Num BoolOpAnd CompareEq NameLoad Num CompareEq NameLoad Num body If UnaryOpNot NameLoad body Raise Call NameLoad Str Assign NameStore BinOpMod Str NameLoad orelse Assign NameStore Str If BoolOpOr BoolOpAnd CompareNotEq NameLoad Num CompareNotEq NameLoad Num BoolOpAnd CompareEq NameLoad Num CompareEq NameLoad Num body If UnaryOpNot NameLoad body Raise Call NameLoad Str Assign NameStore BinOpMod Str NameLoad orelse Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad Return BinOpMod Str NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults Str TupleLoad Num Num body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad If CompareNotEq AttributeLoad AttributeLoad NameLoad attr attr Num body Raise Call NameLoad Str If CompareNotEq AttributeLoad AttributeLoad NameLoad attr attr Num body Raise Call NameLoad Str Assign NameStore ListLoad SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num NameLoad NameLoad Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Return Call NameLoad NameLoad ListLoad NameLoad NameLoad ListLoad Call Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return ListLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assign TupleStore NameStore NameStore NameLoad Assign TupleStore NameStore NameLoad Assign NameStore Str Return Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign TupleStore NameStore NameStore NameLoad Assign TupleStore NameStore NameLoad Assign NameStore Call Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Slice Num Assign NameStore Call Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Slice Num Return TupleLoad NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults Str TupleLoad Num Num body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad If CompareNotEq AttributeLoad AttributeLoad NameLoad attr attr Num body Raise Call NameLoad Str If CompareNotEq AttributeLoad AttributeLoad NameLoad attr attr Num body Raise Call NameLoad Str If BoolOpOr CompareNotEq AttributeLoad NameLoad attr TupleLoad Num Num CompareEq AttributeLoad NameLoad attr Str body If CompareIs NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore ListLoad Call AttributeLoad Call NameLoad SubscriptLoad NameLoad Index Num attr Str Call AttributeLoad Call NameLoad SubscriptLoad NameLoad Index Num attr Str orelse Assign NameStore ListLoad Assign NameStore ListLoad SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num NameLoad NameLoad Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Return Call NameLoad NameLoad BinOpAdd ListLoad NameLoad NameLoad NameLoad ListLoad Call Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore NameStore Num orelse If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore NameStore Num orelse If Call NameLoad AttributeLoad NameLoad attr NameLoad body Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr orelse Assert CompareEq AttributeLoad NameLoad attr Str Assign NameStore NameStore Num Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore SubscriptLoad NameLoad Index Num Assign TupleStore NameStore NameStore TupleLoad SubscriptLoad NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Slice Num Assign TupleStore NameStore NameStore TupleLoad SubscriptLoad NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Slice Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice Num If BoolOpOr CompareNotEq NameLoad Num CompareEq NameLoad Num body Assign NameStore SubscriptLoad NameLoad Index Num orelse If CompareEq NameLoad Num body Assign NameStore BinOpAdd BinOpSub Num SubscriptLoad NameLoad Index Num BinOpMult BinOpSub SubscriptLoad NameLoad Index Num Num NameLoad orelse Assign NameStore BinOpSub BinOpAdd SubscriptLoad NameLoad Index Num BinOpMult Num NameLoad BinOpMult BinOpSub SubscriptLoad NameLoad Index Num Num NameLoad If BoolOpOr CompareNotEq NameLoad Num CompareEq NameLoad Num body Assign NameStore SubscriptLoad NameLoad Index Num orelse If CompareEq NameLoad Num body Assign NameStore BinOpAdd BinOpSub Num SubscriptLoad NameLoad Index Num BinOpMult BinOpSub SubscriptLoad NameLoad Index Num Num NameLoad orelse Assign NameStore BinOpSub BinOpAdd SubscriptLoad NameLoad Index Num BinOpMult Num NameLoad BinOpMult BinOpSub SubscriptLoad NameLoad Index Num Num NameLoad Return ListLoad TupleLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assign TupleStore NameStore NameStore SubscriptLoad NameLoad Slice Num Assign TupleStore NameStore NameStore BoolOpOr SubscriptLoad NameLoad Slice Num TupleLoad NameLoad NameLoad Assign TupleStore NameStore NameLoad Assign NameStore Str Return Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign TupleStore NameStore NameStore SubscriptLoad NameLoad Slice Num Assign TupleStore NameStore NameLoad Assign NameStore Call Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Slice Num Assign NameStore Call Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore IfExp CompareEq Call NameLoad NameLoad Num BinOpMult TupleLoad Call Call AttributeLoad AttributeLoad NameLoad attr attr Num TupleLoad Return BinOpAdd TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If CompareEq AttributeLoad NameLoad attr Num body Return ListLoad ListLoad Num ListLoad Num orelse Return ListLoad ListLoad Num ListLoad Num ListLoad Num ListLoad Num decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults Str TupleLoad Num Num body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad If CompareNotEq AttributeLoad AttributeLoad NameLoad attr attr Num body Raise Call NameLoad Str If CompareNotEq AttributeLoad AttributeLoad NameLoad attr attr Num body Raise Call NameLoad Str If BoolOpAnd CompareNotEq AttributeLoad NameLoad attr TupleLoad Num Num CompareIs NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore IfExp CompareNotEq AttributeLoad NameLoad attr TupleLoad Num Num ListLoad Call AttributeLoad Call NameLoad SubscriptLoad NameLoad Index Num attr Str Call AttributeLoad Call NameLoad SubscriptLoad NameLoad Index Num attr Str ListLoad Assign NameStore ListLoad SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num NameLoad NameLoad Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Return Call NameLoad NameLoad BinOpAdd ListLoad NameLoad NameLoad NameLoad ListLoad Call Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore NameStore Num orelse If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore NameStore Num orelse If Call NameLoad AttributeLoad NameLoad attr NameLoad body Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr orelse Assert CompareEq AttributeLoad NameLoad attr Str Assign NameStore NameStore Num Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore SubscriptLoad NameLoad Index Num Assign TupleStore NameStore NameStore TupleLoad SubscriptLoad NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Slice Num Assign TupleStore NameStore NameStore TupleLoad SubscriptLoad NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Slice Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice Num If CompareEq NameLoad Num body Assign NameStore BinOpFloorDiv SubscriptLoad NameLoad Index Num Num orelse If CompareEq NameLoad Num body Assign NameStore BinOpSub SubscriptLoad NameLoad Index Num Num orelse If CompareLt NameLoad Num body Raise Call NameLoad Str If CompareEq NameLoad Num body Assign NameStore BinOpFloorDiv SubscriptLoad NameLoad Index Num Num orelse If CompareEq NameLoad Num body Assign NameStore BinOpSub SubscriptLoad NameLoad Index Num Num orelse If CompareLt NameLoad Num body Raise Call NameLoad Str If CompareNotEq NameLoad Num body Assign NameStore SubscriptLoad NameLoad Index Num orelse Assign NameStore BinOpSub BinOpAdd BinOpMult BinOpSub SubscriptLoad NameLoad Index Num Num NameLoad SubscriptLoad NameLoad Index Num BinOpMult Num NameLoad If CompareNotEq NameLoad Num body Assign NameStore SubscriptLoad NameLoad Index Num orelse Assign NameStore BinOpSub BinOpAdd BinOpMult BinOpSub SubscriptLoad NameLoad Index Num Num NameLoad SubscriptLoad NameLoad Index Num BinOpMult Num NameLoad Assign NameStore TupleLoad NameLoad NameLoad Return ListLoad BinOpAdd TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assign TupleStore NameStore NameStore SubscriptLoad NameLoad Slice Num Assign TupleStore NameStore NameStore BoolOpOr SubscriptLoad NameLoad Slice Num TupleLoad NameLoad NameLoad Assign TupleStore NameStore NameLoad Assign NameStore Str Return Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign TupleStore NameStore NameStore SubscriptLoad NameLoad Slice Num Assign TupleStore NameStore NameLoad Assign NameStore Call Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Slice Num Assign NameStore Call Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore IfExp CompareEq Call NameLoad NameLoad Num BinOpMult TupleLoad Call Call AttributeLoad AttributeLoad NameLoad attr attr Num TupleLoad Return BinOpAdd TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If CompareEq AttributeLoad NameLoad attr Num body Return ListLoad ListLoad Num ListLoad Num orelse Return ListLoad ListLoad Num ListLoad Num ListLoad Num ListLoad Num decorator_list decorator_list
N/A N/A os N/A logging N/A theano theano Apply theano gof theano.tensor as_tensor_variable TensorType theano.tensor.nnet.abstract_conv get_conv_output_shape theano.tensor.blas_headers blas_header_text theano.tensor.blas ldflags N/A _logger N/A N/A logging getLogger __name__ BaseCorrMM N/A N/A gof Op N/A N/A 
    Base class for `CorrMM`, `CorrMM_gradWeights` and
    `CorrMM_gradInputs`. Cannot be used directly.
    Parameters
    ----------
    border_mode : {'valid', 'full', 'half'}
        Additionally, the padding size could be directly specified by an integer
        or a pair of integers
    subsample
        Perform subsampling of the output (default: (1, 1)).

     N/A check_broadcast False N/A __props__ N/A border_mode subsample __init__ N/A N/A self border_mode subsample N/A valid N/A 1 1 N/A N/A N/A isinstance border_mode int N/A N/A N/A border_mode 0 N/A N/A N/A ValueError N/A N/A invalid border_mode {}, which must be a non-negative integer format border_mode N/A border_mode N/A border_mode border_mode N/A N/A isinstance border_mode tuple N/A N/A N/A N/A N/A len border_mode 2 N/A N/A border_mode N/A 0 0 N/A N/A border_mode N/A 1 0 N/A N/A N/A ValueError N/A N/A invalid border_mode {}, which must be a pair of non-negative integers format border_mode N/A N/A pad_h pad_w N/A map int border_mode N/A border_mode N/A pad_h pad_w N/A N/A N/A N/A N/A isinstance border_mode tuple N/A N/A min border_mode 0 N/A border_mode N/A valid full half N/A N/A N/A ValueError N/A N/A invalid border_mode {}, which must be either "valid", "full", "half", an integer or a pair of integers format border_mode N/A N/A self border_mode border_mode N/A N/A N/A len subsample 2 N/A N/A N/A ValueError subsample must have two elements N/A N/A self subsample N/A tuple subsample N/A pad N/A N/A self N/A N/A N/A N/A N/A self border_mode valid N/A N/A N/A self border_mode N/A N/A 0 0 N/A property __str__ N/A N/A self N/A N/A N/A N/A %s{%s, %s} N/A N/A N/A self __class__ __name__ N/A self border_mode N/A str N/A self subsample N/A c_support_code N/A N/A self N/A N/A N/A N/A blas_header_text N/A c_libraries N/A N/A self N/A N/A N/A N/A ldflags N/A c_compile_args N/A N/A self N/A N/A N/A N/A ldflags libs False flags True N/A c_lib_dirs N/A N/A self N/A N/A N/A N/A ldflags libs False libs_dir True N/A c_header_dirs N/A N/A self N/A N/A N/A N/A ldflags libs False include_dir True N/A c_headers N/A N/A self N/A N/A N/A N/A <stdio.h> N/A c_code_cache_version N/A N/A self N/A N/A N/A N/A 1 1 N/A c_support_code_apply N/A N/A self node nodename N/A N/A N/A sub N/A N/A dtype N/A str N/A N/A N/A N/A node __dict__ N/A inputs N/A 0 dtype N/A N/A dtype N/A float32 float64 N/A N/A dtype float32 N/A N/A N/A sub N/A gemm sgemm_ N/A N/A sub N/A float_type npy_float N/A N/A sub N/A float_typenum NPY_FLOAT N/A N/A sub N/A n_bytes 4 N/A N/A sub N/A c_float_type float N/A N/A N/A sub N/A gemm dgemm_ N/A N/A sub N/A float_type npy_double N/A N/A sub N/A float_typenum NPY_DOUBLE N/A N/A sub N/A n_bytes 8 N/A N/A sub N/A c_float_type double N/A files N/A corr_gemm.c N/A codes N/A N/A N/A N/A open N/A N/A N/A os path join N/A N/A N/A N/A os path split __file__ N/A 0 f read N/A f files N/A final_code N/A code codes N/A N/A final_code code N/A N/A final_code sub N/A c_code_helper N/A N/A self bottom weights top direction sub height width N/A None None N/A N/A 
        This generates the C code for CorrMM (direction="forward"),
        CorrMM_gradWeights (direction="backprop weights"), and
        CorrMM_gradInputs (direction="backprop inputs").
        Depending on the direction, one of bottom, weights, top will
        receive the output, while the other two serve as inputs.

        :param bottom: Variable name of the input images in the forward pass,
            or the gradient of the input images in backprop wrt. inputs
        :param weights: Variable name of the filters in the forward pass,
            or the gradient of the filters in backprop wrt. weights
        :param top: Variable name of the output images / feature maps in the
            forward pass, or the gradient of the outputs in the backprop passes
        :param direction: "forward" to correlate bottom with weights and store
            results in top,
            "backprop weights" to do a valid convolution of bottom with top
            (swapping the first two dimensions) and store results in weights,
            and "backprop inputs" to do a full convolution of top with weights
            (swapping the first two dimensions) and store results in bottom.
        :param sub: Dictionary of substitutions useable to help generating the
            C code.
        :param height: If self.subsample[0] != 1, a variable giving the height
            of the filters for direction="backprop weights" or the height of
            the input images for direction="backprop inputs".

            If self.border_mode == 'half', a variable giving the height of the
            filters for direction="backprop weights".  Ignored otherwise.
        :param width: If self.subsample[1] != 1, a variable giving the width
            of the filters for direction="backprop weights" or the width of the
            input images for direction="backprop inputs".

            If self.border_mode == 'half', a variable giving the width of the
            filters for direction="backprop weights".  Ignored otherwise.
         N/A N/A dH dW N/A self subsample N/A N/A N/A self border_mode half N/A N/A padH padW -1 N/A N/A N/A N/A self border_mode full N/A N/A padH padW -2 N/A N/A N/A isinstance N/A self border_mode tuple N/A N/A N/A padH padW N/A self border_mode N/A N/A N/A N/A self border_mode valid N/A padH padW 0 N/A N/A direction forward N/A N/A direction 0 N/A out top N/A N/A N/A direction backprop weights N/A N/A direction 1 N/A out weights N/A N/A N/A direction backprop inputs N/A N/A direction 2 N/A out bottom N/A N/A N/A ValueError direction must be one of 'forward', 'backprop weights', 'backprop inputs' N/A N/A N/A N/A direction 0 N/A dH 1 N/A N/A direction 1 N/A padH -1 N/A N/A N/A height N/A N/A N/A ValueError height must be given for backprop with vertical sampling or border_mode='half' N/A height N/A (*(npy_int64 *)(PyArray_DATA(%s))) height N/A N/A height -1 N/A N/A N/A N/A direction 0 N/A dW 1 N/A N/A direction 1 N/A padW -1 N/A N/A N/A width N/A N/A N/A ValueError width must be given for backprop with horizontal sampling or border_mode='half' N/A width N/A (*(npy_int64 *)(PyArray_DATA(%s))) width N/A N/A width -1 N/A sub N/A N/A sub copy N/A N/A N/A sub update N/A locals N/A N/A 
    // Mandatory args
    int direction = %(direction)s;  // forward, bprop weights, bprop inputs

    // Optional args
    int dH = %(dH)s;
    int dW = %(dW)s;
    int padH = %(padH)s;
    int padW = %(padW)s;

    PyArrayObject * bottom = %(bottom)s;
    PyArrayObject * weights = %(weights)s;
    PyArrayObject * top = %(top)s;
    PyArrayObject * out2 = NULL;

    // Obtain or infer kernel width and height
    // (we need to know it early to be able to handle auto-padding)
    int kH, kW;
    if (direction != 1) {
        // weight is an input variable, we can just read its shape
        kH = PyArray_DIMS(weights)[2];
        kW = PyArray_DIMS(weights)[3];
    }
    else {
        if ((dH != 1) || (padH == -1)) {
            // vertical subsampling or half padding, kernel height is specified
            kH = %(height)s;
        }
        else if (padH == -2) {
            // vertical full padding, we can infer the kernel height
            kH = 2 - PyArray_DIMS(bottom)[2] + (PyArray_DIMS(top)[2] - 1) * dH;
        }
        else {
            // explicit padding, we can infer the kernel height
            kH = PyArray_DIMS(bottom)[2] + 2*padH - (PyArray_DIMS(top)[2] - 1) * dH;
        }
        if ((dW != 1) || (padW == -1)) {
            kW = %(width)s;
        }
        else if (padW == -2) {
            kW = 2 - PyArray_DIMS(bottom)[3] + (PyArray_DIMS(top)[3] - 1) * dW;
        }
        else {
            kW = PyArray_DIMS(bottom)[3] + 2*padW - (PyArray_DIMS(top)[3] - 1) * dW;
        }
    }

    // Auto-padding if requested
    if (padH == -1) {  // vertical half padding
        padH = kH / 2;
    }
    else if (padH == -2) {  // vertical full padding
        padH = kH - 1;
    }
    else if (padH < 0) {
        PyErr_SetString(PyExc_ValueError, "BaseCorrMM: padH must be >= -2");
        %(fail)s
    }
    if (padW == -1) {  // horizontal half padding
        padW = kW / 2;
    }
    else if (padW == -2) {  // horizontal full padding
        padW = kW - 1;
    }
    else if (padW < 0) {
        PyErr_SetString(PyExc_ValueError, "BaseCorrMM: padW must be >= -2");
        %(fail)s
    }

    // Infer output shape
    npy_intp out_dim[4];
    switch(direction) {
    case 0:  // forward pass
        // output is top: (batchsize, num_filters, height, width)
        // height and width: top = (bottom + 2*pad - weight) / sample + 1
        out_dim[0] = (npy_intp)PyArray_DIMS(bottom)[0];
        out_dim[1] = (npy_intp)PyArray_DIMS(weights)[0];
        out_dim[2] = (npy_intp)((PyArray_DIMS(bottom)[2] + 2*padH - PyArray_DIMS(weights)[2]) / dH + 1);
        out_dim[3] = (npy_intp)((PyArray_DIMS(bottom)[3] + 2*padW - PyArray_DIMS(weights)[3]) / dW + 1);
        break;
    case 1:  // backprop wrt. weights
        // output is weights: (num_filters, num_channels, height, width)
        // height and width: weights = bottom + 2*pad - (top - 1) * sample
        out_dim[0] = (npy_intp)PyArray_DIMS(top)[1];
        out_dim[1] = (npy_intp)PyArray_DIMS(bottom)[1];
        out_dim[2] = (npy_intp)kH;  // already inferred further above
        out_dim[3] = (npy_intp)kW;  // how convenient
        break;
    case 2:  // backprop wrt. inputs
        // output is bottom: (batchsize, num_channels, height, width)
        // height and width: bottom = (top - 1) * sample + weights - 2*pad
        out_dim[0] = (npy_intp)PyArray_DIMS(top)[0];
        out_dim[1] = (npy_intp)PyArray_DIMS(weights)[1];
        out_dim[2] = (npy_intp)((dH != 1) ? %(height)s : (PyArray_DIMS(top)[2] - 1) * dH + PyArray_DIMS(weights)[2] - 2*padH);
        out_dim[3] = (npy_intp)((dW != 1) ? %(width)s : (PyArray_DIMS(top)[3] - 1) * dW + PyArray_DIMS(weights)[3] - 2*padW);
        break;
    default:
        PyErr_SetString(PyExc_ValueError, "BaseCorrMM: direction must be 0, 1, or 2\n");
        %(fail)s
    }

    // Prepare output array
    int typenum;
    if ( !(%(out)s
           && PyArray_NDIM(%(out)s)==4
           && PyArray_IS_C_CONTIGUOUS(%(out)s)
           && PyArray_DIMS(%(out)s)[0]==out_dim[0]
           && PyArray_DIMS(%(out)s)[1]==out_dim[1]
           && PyArray_DIMS(%(out)s)[2]==out_dim[2]
           && PyArray_DIMS(%(out)s)[3]==out_dim[3]))
    {
        Py_XDECREF(%(out)s);
        if (direction != 1) {
          typenum = PyArray_TYPE(weights);
        }
        else {
          typenum = PyArray_TYPE(bottom);
        }
        %(out)s = (PyArrayObject*)PyArray_EMPTY(4,
                                          out_dim,
                                          typenum,
                                          0);
        if (NULL == %(out)s)
        {
            PyErr_Format(PyExc_RuntimeError,
                    "BaseCorrMM: Failed to allocate output of %%lld x %%lld x %%lld x %%lld",
                    (long long)out_dim[0], (long long)out_dim[1], (long long)out_dim[2], (long long)out_dim[3]);
            %(fail)s
        }
    }

    // Call corrMM code
    out2 = corrMM(%(bottom)s, %(weights)s, %(top)s, direction, dH, dW, padH, padW);
    if (out2==NULL){
       %(fail)s
    }
    assert (out2 == %(out)s);

 sub N/A N/A CorrMM N/A BaseCorrMM N/A N/A 
    CPU correlation implementation using Matrix Multiplication.

    Parameters
    ----------
    border_mode
        The width of a border of implicit zeros to pad the
        input with. Must be a tuple with 2 elements giving the numbers of rows
        and columns to pad on each side, or a single integer to pad the same
        on all sides, or a string shortcut setting the padding at runtime:
        ``'valid'`` for ``(0, 0)`` (valid convolution, no padding), ``'full'``
        for ``(kernel_rows - 1, kernel_columns - 1)`` (full convolution),
        ``'half'`` for ``(kernel_rows // 2, kernel_columns // 2)`` (same
        convolution for odd-sized kernels). Note that the two widths are each
        applied twice, once per side (left and right, top and bottom).
    subsample
        The subsample operation applied to each output image.
        Should be a tuple with 2 elements.
        `(sv, sh)` is equivalent to `CorrMM(...)(...)[:,:,::sv, ::sh]`,
        but faster.
        Set to `(1, 1)` to disable subsampling.

     __init__ N/A N/A self border_mode subsample N/A valid N/A 1 1 N/A N/A N/A N/A N/A super CorrMM self __init__ border_mode subsample N/A make_node N/A N/A self img kern N/A N/A N/A img N/A as_tensor_variable img N/A kern N/A as_tensor_variable kern N/A N/A N/A N/A img type ndim 4 N/A N/A N/A TypeError img must be 4D tensor N/A N/A N/A N/A kern type ndim 4 N/A N/A N/A TypeError kern must be 4D tensor N/A broadcastable N/A N/A N/A N/A img type broadcastable N/A 0 N/A N/A N/A kern type broadcastable N/A 0 False False N/A dtype N/A N/A img type dtype N/A N/A Apply self N/A img kern N/A N/A N/A TensorType dtype broadcastable N/A infer_shape N/A N/A self node input_shape N/A N/A N/A imshp N/A input_shape N/A 0 N/A kshp N/A input_shape N/A 1 N/A res N/A get_conv_output_shape imshp kshp N/A self border_mode N/A self subsample N/A N/A res N/A c_code N/A N/A self node nodename inp out_ sub N/A N/A N/A N/A bottom weights inp N/A N/A top out_ N/A direction forward N/A N/A N/A N/A super CorrMM self c_code_helper bottom weights top direction sub N/A grad N/A N/A self inp grads N/A N/A N/A N/A bottom weights inp N/A N/A top grads N/A d_bottom N/A N/A CorrMM_gradInputs N/A self border_mode N/A self subsample weights top N/A N/A bottom shape N/A -2 N/A d_weights N/A N/A CorrMM_gradWeights N/A self border_mode N/A self subsample bottom top N/A N/A weights shape N/A -2 N/A N/A d_bottom d_weights N/A N/A CorrMM_gradWeights N/A BaseCorrMM N/A N/A 
    Gradient wrt. filters for `CorrMM`.

    Notes
    -----
    You will not want to use this directly, but rely on
    Theano's automatic differentiation or graph optimization to
    use it as needed.

     __init__ N/A N/A self border_mode subsample N/A valid N/A 1 1 N/A N/A N/A N/A N/A super CorrMM_gradWeights self __init__ border_mode subsample N/A make_node N/A N/A self img topgrad shape N/A None N/A N/A img N/A as_tensor_variable img N/A topgrad N/A as_tensor_variable topgrad N/A N/A N/A N/A img type ndim 4 N/A N/A N/A TypeError img must be 4D tensor N/A N/A N/A N/A topgrad type ndim 4 N/A N/A N/A TypeError topgrad must be 4D tensor N/A N/A N/A N/A self subsample N/A 1 1 N/A N/A self border_mode half N/A N/A N/A shape None N/A N/A N/A ValueError shape must be given if subsample != (1, 1) or border_mode == "half" N/A height_width N/A N/A N/A N/A as_tensor_variable N/A shape N/A 0 astype int64 N/A N/A N/A as_tensor_variable N/A shape N/A 1 astype int64 N/A N/A height_width N/A N/A broadcastable N/A N/A N/A N/A topgrad type broadcastable N/A 1 N/A N/A N/A img type broadcastable N/A 1 False False N/A dtype N/A N/A img type dtype N/A N/A Apply self N/A N/A img topgrad height_width N/A N/A N/A TensorType dtype broadcastable N/A infer_shape N/A N/A self node input_shape N/A N/A N/A N/A N/A self border_mode half N/A N/A padH padW -1 N/A N/A N/A N/A self border_mode full N/A N/A padH padW -2 N/A N/A N/A isinstance N/A self border_mode tuple N/A N/A N/A padH padW N/A self border_mode N/A N/A N/A N/A self border_mode valid N/A padH padW 0 N/A N/A dH dW N/A self subsample N/A imshp N/A input_shape N/A 0 N/A topshp N/A input_shape N/A 1 N/A N/A ssize imshp N/A N/A imshp N/A 1 N/A list N/A imshp N/A 2 N/A N/A nkern topshp N/A N/A topshp N/A 1 N/A list N/A topshp N/A 2 N/A height_width N/A N/A node inputs N/A -2 N/A N/A N/A dH 1 N/A padH -1 N/A N/A kH N/A height_width N/A 0 N/A N/A N/A padH -2 N/A N/A kH N/A N/A 2 N/A imshp N/A 0 N/A N/A N/A topshp N/A 0 1 dH N/A N/A kH N/A N/A N/A imshp N/A 0 N/A 2 padH N/A N/A N/A topshp N/A 0 1 dH N/A N/A N/A dW 1 N/A padW -1 N/A N/A kW N/A height_width N/A 1 N/A N/A N/A padW -2 N/A N/A kW N/A N/A 2 N/A imshp N/A 1 N/A N/A N/A topshp N/A 1 1 dW N/A N/A kW N/A N/A N/A imshp N/A 1 N/A 2 padW N/A N/A N/A topshp N/A 1 1 dW N/A N/A N/A nkern ssize kH kW N/A c_code N/A N/A self node nodename inp out_ sub N/A N/A N/A N/A bottom top N/A inp N/A 2 N/A N/A height width N/A N/A inp N/A 2 N/A None None N/A N/A weights out_ N/A direction backprop weights N/A N/A N/A N/A super CorrMM_gradWeights self c_code_helper bottom weights top direction sub height width N/A grad N/A N/A self inp grads N/A N/A N/A N/A bottom top N/A inp N/A 2 N/A N/A weights grads N/A d_bottom N/A N/A CorrMM_gradInputs N/A self border_mode N/A self subsample weights top N/A N/A bottom shape N/A -2 N/A d_top N/A N/A CorrMM N/A self border_mode N/A self subsample bottom weights N/A d_height_width N/A N/A N/A len inp 4 N/A N/A N/A N/A N/A N/A theano gradient DisconnectedType 2 N/A N/A N/A N/A d_bottom d_top d_height_width N/A connection_pattern N/A N/A self node N/A N/A N/A N/A N/A node nin 2 N/A N/A N/A N/A 1 N/A 1 N/A N/A N/A N/A 1 N/A 1 N/A 0 N/A 0 N/A N/A CorrMM_gradInputs N/A BaseCorrMM N/A N/A 
    Gradient wrt. inputs for `CorrMM`.

    Notes
    -----
    You will not want to use this directly, but rely on
    Theano's automatic differentiation or graph optimization to
    use it as needed.

     __init__ N/A N/A self border_mode subsample N/A valid N/A 1 1 N/A N/A N/A N/A N/A super CorrMM_gradInputs self __init__ border_mode subsample N/A make_node N/A N/A self kern topgrad shape N/A None N/A N/A kern N/A as_tensor_variable kern N/A topgrad N/A as_tensor_variable topgrad N/A N/A N/A N/A kern type ndim 4 N/A N/A N/A TypeError kern must be 4D tensor N/A N/A N/A N/A topgrad type ndim 4 N/A N/A N/A TypeError topgrad must be 4D tensor N/A N/A N/A N/A self subsample N/A 1 1 N/A shape None N/A N/A N/A ValueError shape must be given if subsample != (1, 1) N/A height_width N/A N/A N/A self subsample N/A 1 1 N/A N/A N/A N/A as_tensor_variable N/A shape N/A 0 astype int64 N/A N/A N/A as_tensor_variable N/A shape N/A 1 astype int64 N/A N/A broadcastable N/A N/A N/A N/A topgrad type broadcastable N/A 0 N/A N/A N/A kern type broadcastable N/A 1 False False N/A dtype N/A N/A kern type dtype N/A N/A Apply self N/A N/A kern topgrad height_width N/A N/A N/A TensorType dtype broadcastable N/A infer_shape N/A N/A self node input_shape N/A N/A N/A N/A N/A self border_mode half N/A N/A padH padW -1 N/A N/A N/A N/A self border_mode full N/A N/A padH padW -2 N/A N/A N/A isinstance N/A self border_mode tuple N/A N/A N/A padH padW N/A self border_mode N/A N/A N/A N/A self border_mode valid N/A padH padW 0 N/A N/A dH dW N/A self subsample N/A kshp N/A input_shape N/A 0 N/A topshp N/A input_shape N/A 1 N/A N/A ssize kshp N/A N/A kshp N/A 1 N/A list N/A kshp N/A 2 N/A N/A bsize topshp N/A N/A topshp N/A 0 N/A list N/A topshp N/A 2 N/A height_width N/A N/A node inputs N/A -2 N/A N/A padH -1 N/A N/A padH N/A N/A kshp N/A 0 2 N/A N/A N/A padH -2 N/A N/A padH N/A N/A kshp N/A 0 1 N/A N/A N/A padH -2 N/A N/A N/A ValueError CorrMM_gradInputs: border_mode must be >= 0. N/A N/A padW -1 N/A N/A padW N/A N/A kshp N/A 1 2 N/A N/A N/A padW -2 N/A N/A padW N/A N/A kshp N/A 1 1 N/A N/A N/A padW -2 N/A N/A N/A ValueError CorrMM_gradInputs: border_mode must be >= 0. N/A N/A dH 1 N/A N/A out_shp0 N/A height_width N/A 0 N/A N/A out_shp0 N/A N/A N/A N/A N/A topshp N/A 0 1 dH N/A kshp N/A 0 N/A 2 padH N/A N/A dW 1 N/A N/A out_shp1 N/A height_width N/A 1 N/A N/A out_shp1 N/A N/A N/A N/A N/A topshp N/A 1 1 dW N/A kshp N/A 1 N/A 2 padW N/A out_shp N/A out_shp0 out_shp1 N/A N/A N/A N/A bsize ssize out_shp N/A c_code N/A N/A self node nodename inp out_ sub N/A N/A N/A N/A weights top N/A inp N/A 2 N/A N/A height width N/A N/A inp N/A 2 N/A None None N/A N/A bottom out_ N/A direction backprop inputs N/A N/A N/A N/A super CorrMM_gradInputs self c_code_helper bottom weights top direction sub height width N/A grad N/A N/A self inp grads N/A N/A N/A N/A weights top N/A inp N/A 2 N/A N/A bottom grads N/A d_weights N/A N/A CorrMM_gradWeights N/A self border_mode N/A self subsample bottom top N/A N/A weights shape N/A -2 N/A d_top N/A N/A CorrMM N/A self border_mode N/A self subsample bottom weights N/A d_height_width N/A N/A N/A len inp 4 N/A N/A N/A N/A N/A N/A theano gradient DisconnectedType 2 N/A N/A N/A N/A d_weights d_top d_height_width N/A connection_pattern N/A N/A self node N/A N/A N/A N/A N/A node nin 2 N/A N/A N/A N/A 1 N/A 1 N/A N/A N/A N/A 1 N/A 1 N/A 0 N/A 0 N/A N/A