Skip to content

Commit 737bea8

Browse files
basaundifchollet
authored andcommitted
Cropping1D, zero right padding (keras-team#4860)
1 parent c2e36f3 commit 737bea8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

keras/layers/convolutional.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1649,7 +1649,10 @@ def get_output_shape_for(self, input_shape):
16491649
input_shape[2])
16501650

16511651
def call(self, x, mask=None):
1652-
return x[:, self.cropping[0]:-self.cropping[1], :]
1652+
if self.cropping[1] == 0:
1653+
return x[:, self.cropping[0]:, :]
1654+
else:
1655+
return x[:, self.cropping[0]:-self.cropping[1], :]
16531656

16541657
def get_config(self):
16551658
config = {'cropping': self.cropping}

0 commit comments

Comments
 (0)