Skip to content

Instantly share code, notes, and snippets.

@ktakayama
Created August 24, 2022 00:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ktakayama/db97197ffab3f4d7e05140a8c683eb95 to your computer and use it in GitHub Desktop.
Save ktakayama/db97197ffab3f4d7e05140a8c683eb95 to your computer and use it in GitHub Desktop.
--- functional.py_ 2022-08-23 17:07:29.000000000 +0900
+++ functional.py 2022-08-23 17:07:31.000000000 +0900
@@ -2506,9 +2506,9 @@ def layer_norm(
"""
if has_torch_function_variadic(input, weight, bias):
return handle_torch_function(
- layer_norm, (input, weight, bias), input, normalized_shape, weight=weight, bias=bias, eps=eps
+ layer_norm, (input.contiguous(), weight, bias), input, normalized_shape, weight=weight, bias=bias, eps=eps
)
- return torch.layer_norm(input, normalized_shape, weight, bias, eps, torch.backends.cudnn.enabled)
+ return torch.layer_norm(input.contiguous(), normalized_shape, weight, bias, eps, torch.backends.cudnn.enabled)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment