8000 Improve nn.legacy compatibility with Torch7 (#738) · pytorch/pytorch@937ba58 · GitHub
[go: up one dir, main page]

Skip to content

Commit 937ba58

Browse files
mvitezsoumith
authored andcommitted
Improve nn.legacy compatibility with Torch7 (#738)
1 parent 2ae54f1 commit 937ba58

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

torch/legacy/nn/SpatialMaxPooling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def floor(self):
3131
return self
3232

3333
def updateOutput(self, input):
34-
if self.indices is None:
34+
if not hasattr(self, 'indices') or self.indices is None:
3535
self.indices = input.new()
3636
self.indices = self.indices.long()
3737

torch/utils/serialization/read_lua_file.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ def ensure_type(obj, type_map):
396396
decrement('Index', 'dimension')
397397
decrement('SelectTable', 'index')
398398
decrement('SplitTable', 'dimension')
399+
decrement_positive('JoinTable', 'dimension')
399400 432F
decrement('Parallel', 'inputDimension', 'outputDimension')
400401
decrement('Concat', 'dimension')
401402
decrement('DepthConcat', 'dimension')

0 commit comments

Comments
 (0)
0