Commit e094c3bf authored by rusty1s's avatar rusty1s
Browse files

added assert

parent eb413124
...@@ -4,6 +4,9 @@ from .utils.ffi import grid ...@@ -4,6 +4,9 @@ from .utils.ffi import grid
def grid_cluster(pos, size, start=None, end=None): def grid_cluster(pos, size, start=None, end=None):
pos = pos.unsqueeze(-1) if pos.dim() == 1 else pos pos = pos.unsqueeze(-1) if pos.dim() == 1 else pos
assert pos.size(1) == size.size(0), (
'Last dimension of position tensor must have same size as size tensor')
start = pos.t().min(dim=1)[0] if start is None else start start = pos.t().min(dim=1)[0] if start is None else start
end = pos.t().max(dim=1)[0] if end is None else end end = pos.t().max(dim=1)[0] if end is None else end
pos, end = pos - start, end - start pos, end = pos - start, end - start
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment