Commit 08dda1ad authored by rusty1s's avatar rusty1s
Browse files

coverage

parent 7d5034ba
......@@ -20,7 +20,8 @@ def gen(src, index, dim=-1, out=None, dim_size=None, fill_value=0):
index_size[dim] = src.size(dim)
if index.numel() > 0:
index = index.view(index_size).expand_as(src)
else: # PyTorch has a bug when view is used on zero-element tensors.
else: # pragma: no cover
# PyTorch has a bug when view is used on zero-element tensors.
index = src.new_empty(index_size, dtype=torch.long)
# Broadcasting capabilties: Expand dimensions to match.
......
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