def output_same_shape(out_arg_name, in_arg_name):
    return """
    const int *%(out_arg_name)s_dims = %(in_arg_name)s_dims;

    if (CudaNdarray_prep_output(& %%(%(out_arg_name)s)s, 4,
                                %(out_arg_name)s_dims))
    {
        %%(fail)s;
    }

    { // setup_nv_%(out_arg_name)s brace #1
    NVMatrix nv_%(out_arg_name)s(%%(%(out_arg_name)s)s,
     %(out_arg_name)s_dims[0] * %(out_arg_name)s_dims[1] *
     %(out_arg_name)s_dims[2],
     %(out_arg_name)s_dims[3], "%%(class_name)s:nv_%(out_arg_name)s");
    """ % locals()
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/sandbox/cuda_convnet/code_templates.py/output_same_shape/original