Skip to content

Commit

Permalink
merge from master
Browse files Browse the repository at this point in the history
  • Loading branch information
ynonaolga committed Nov 14, 2022
1 parent f830d7f commit ee378ee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions torch/nn/functional.py
Expand Up @@ -2524,6 +2524,8 @@ def group_norm(
"""
if has_torch_function_variadic(input, weight, bias):
return handle_torch_function(group_norm, (input, weight, bias,), input, num_groups, weight=weight, bias=bias, eps=eps)
if input.dim() < 2:
raise RuntimeError(f"Expected at least 2 dimensions for input tensor but received {input.dim()}")
_verify_batch_size([input.size(0) * input.size(1) // num_groups, num_groups] + list(input.size()[2:]))
return torch.group_norm(input, num_groups, weight, bias, eps, torch.backends.cudnn.enabled)

Expand Down

0 comments on commit ee378ee

Please sign in to comment.