Skip to content

Commit

Permalink
Merge branch 'keras-2' of github.com:fchollet/keras into keras-2
Browse files Browse the repository at this point in the history
  • Loading branch information
fchollet committed Mar 13, 2017
2 parents 859ffeb + b377edf commit 4c56f32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions keras/backend/tensorflow_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1874,16 +1874,17 @@ def spatial_3d_padding(x, padding=((1, 1), (1, 1), (1, 1)), data_format=None):
return tf.pad(x, pattern)


def stack(x):
def stack(x, axis=0):
"""Stacks a list of rank `R` tensors into a rank `R+1` tensor.
# Arguments
x: Tensor or variable.
x: List of tensors.
axis: Axis along which to perform stacking.
# Returns
A tensor.
"""
return tf.stack(x)
return tf.stack(x, axis=axis)


def one_hot(indices, num_classes):
Expand Down
4 changes: 2 additions & 2 deletions keras/backend/theano_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -985,8 +985,8 @@ def spatial_3d_padding(x, padding=((1, 1), (1, 1), (1, 1)), data_format=None):
return T.set_subtensor(output[indices], x)


def stack(x):
return T.stack(*x)
def stack(x, axis=0):
return T.stack(x, axis=axis)


def one_hot(indices, num_classes):
Expand Down

0 comments on commit 4c56f32

Please sign in to comment.