提交 36706769 authored 作者: Frederic's avatar Frederic

Better conv2d docstring

上级 96839cb3
......@@ -16,7 +16,7 @@ import numpy
import theano
from theano.tensor import (as_tensor_variable, blas, get_scalar_constant_value,
patternbroadcast)
patternbroadcast, NotScalarConstantError)
from theano import OpenMPOp, config
from theano.gof import Apply
from theano.gof.python25 import any
......@@ -56,13 +56,16 @@ def conv2d(input, filters, image_shape=None, filter_shape=None,
:type subsample: tuple of len 2
:param subsample: factor by which to subsample the output
:type image_shape: tuple of len 4 of int or Constant variable
:type image_shape: None, tuple/list of len 4 of int or Constant variable
:param image_shape: (batch size, stack size, nb row, nb col)
Optional, used for optimization.
:type filter_shape: tuple of len 4 of int or Constant variable
Optional, used for optimization like loop unrolling
You can put None for any element of the list
to tell that this element is not constant.
:type filter_shape: None, tuple/list of len 4 of int or Constant variable
:param filter_shape: (nb filters, stack size, nb row, nb col)
Optional, used for optimization.
Optional, used for optimization like loop unrolling
You can put None for any element of the list
to tell that this element is not constant.
:param kwargs: kwargs are passed onto ConvOp.
Can be used to set the following:
unroll_batch, unroll_kern, unroll_patch,
......
......@@ -25,7 +25,18 @@ class TestConv2D(utt.InferShapeTester):
input=None, filters=None,
unroll_batch=None, unroll_kern=None, unroll_patch=None,
verify_grad=True, should_raise=False):
"""
:param image_shape: The constant shape info passed to conv2d.
:param filter_shape: The constant shape info passed to conv2d.
:param N_image_shape: None(default to image_shape) or tuple of
4 elements with the shape of the input image
:param N_filter_shape: None(default to filter_shape) or tuple
of 4 elements with the shape of the
input filter
"""
if N_image_shape is None:
N_image_shape = [T.get_scalar_constant_value(T.
as_tensor_variable(x)) for x in image_shape]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论