Skip to content

Commit

Permalink
Add reshape shortcut for ReshapeLayer
Browse files Browse the repository at this point in the history
  • Loading branch information
f0k committed Feb 7, 2015
1 parent 461d992 commit cd34882
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lasagne/layers/shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"FlattenLayer",
"flatten",
"ReshapeLayer",
"reshape",
"PadLayer",
"pad",
]
Expand Down Expand Up @@ -134,6 +135,8 @@ def get_output_for(self, input, *args, **kwargs):
# Everything else is handled by Theano
return input.reshape(tuple(output_shape))

reshape = ReshapeLayer # shortcut


class PadLayer(Layer):
def __init__(self, incoming, width, val=0, batch_ndim=2, **kwargs):
Expand All @@ -155,4 +158,4 @@ def get_output_shape_for(self, input_shape):
def get_output_for(self, input, *args, **kwargs):
return padding.pad(input, self.width, self.val, self.batch_ndim)

pad = PadLayer # shortcut
pad = PadLayer # shortcut

0 comments on commit cd34882

Please sign in to comment.