Skip to content

Commit

Permalink
Revert variable name change as this break user interface and numpy co…
Browse files Browse the repository at this point in the history
…mpatibility
  • Loading branch information
nouiz committed Oct 23, 2014
1 parent c331362 commit 9e439d5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions theano/tensor/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2016,26 +2016,26 @@ def zeros_like(model, dtype=None):
return fill(model, constant(0.0, dtype=dtype))


def zeros(shp, dtype=None):
def zeros(shape, dtype=None):
"""
Create a Tensor filled with zeros, closer to Numpy's syntax than ``alloc``.
"""
if not isinstance(shp, (list, tuple, TensorVariable)):
shp = [shp]
if not isinstance(shape, (list, tuple, TensorVariable)):
shape = [shape]
if dtype is None:
dtype = config.floatX
return alloc(numpy.array(0, dtype=dtype), *shp)
return alloc(numpy.array(0, dtype=dtype), *shape)


def ones(shp, dtype=None):
def ones(shape, dtype=None):
"""
Create a Tensor filled with ones, closer to Numpy's syntax than ``alloc``.
"""
if not isinstance(shp, (list, tuple, TensorVariable)):
shp = [shp]
if not isinstance(shape, (list, tuple, TensorVariable)):
shape = [shape]
if dtype is None:
dtype = config.floatX
return alloc(numpy.array(1, dtype=dtype), *shp)
return alloc(numpy.array(1, dtype=dtype), *shape)


class Nonzero(gof.Op):
Expand Down

0 comments on commit 9e439d5

Please sign in to comment.