Skip to content

Commit

Permalink
add asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
mariogeiger committed Aug 8, 2019
1 parent 284f27c commit c91bd59
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions se3cnn/point/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def forward(self, features, geometry):
:param geometry: tensor [batch, point, xyz]
:return: tensor [batch, point, channel]
"""
assert features.size()[:2] == geometry.size()[:2], "features size ({}) and geometry size ({}) should match".format(features.size(), geometry.size())
rb = geometry.unsqueeze(1) # [batch, 1, b, xyz]
ra = geometry.unsqueeze(2) # [batch, a, 1, xyz]
k = self.kernel(rb - ra) # [batch, a, b, i, j]
Expand All @@ -31,6 +32,7 @@ def forward(self, features, geometry):
:param geometry: tensor [batch, point, xyz]
:return: tensor [batch, point, point, channel]
"""
assert features.size()[:2] == geometry.size()[:2], "features size ({}) and geometry size ({}) should match".format(features.size(), geometry.size())
rb = geometry.unsqueeze(1) # [batch, 1, b, xyz]
ra = geometry.unsqueeze(2) # [batch, a, 1, xyz]
k = self.kernel(rb - ra) # [batch, a, b, i, j]
Expand All @@ -50,6 +52,7 @@ def forward(self, features, geometry):
:param geometry: tensor [batch, point, xyz]
:return: tensor [batch, point, channel]
"""
assert features.size()[:2] == geometry.size()[:2], "features size ({}) and geometry size ({}) should match".format(features.size(), geometry.size())
batch, n, _ = geometry.size()

rb = geometry.unsqueeze(1) # [batch, 1, b, xyz]
Expand Down

0 comments on commit c91bd59

Please sign in to comment.