Skip to content

Commit 205470e

Browse files
author
Haifeng Han
committed
reformat shape.py
1 parent 298438d commit 205470e

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

python/shape.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,19 @@ def setup(self, bottom, top):
1212
if len(bottom) != 1:
1313
raise Exception("Only input one Tensor at a time!")
1414
if len(top) != 1:
15-
raise Exception("Only output one Tensor at a time!")
16-
17-
# other parameters...
18-
15+
raise Exception("Only output one Tensor at a time!")
1916

2017
def reshape(self, bottom, top):
2118
# check input dimensions
2219
if bottom[0].count == 0:
2320
raise Exception("Input must not be empty!")
2421
top[0].reshape(len(bottom[0].data.shape))
25-
2622

2723
def forward(self, bottom, top):
28-
top[0].data[...] = bottom[0].data.shape
29-
24+
top[0].data[...] = bottom[0].data.shape
3025

3126
def backward(self, top, propagate_down, bottom):
32-
for i in range(len(propagate_down)):
27+
for i in range(len(propagate_down)):
3328
if not propagate_down[i]:
3429
continue
3530
bottom[i].diff[...] = top[i].diff[:]

0 commit comments

Comments
 (0)