pad_circular -> _pad_circular (#18608)
authorSoumith Chintala <soumith@gmail.com>
Sat, 30 Mar 2019 20:24:11 +0000 (13:24 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sat, 30 Mar 2019 20:27:04 +0000 (13:27 -0700)
Summary:
pad_circular is really private, as circular padding is exposed via `F.pad`
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18608

Differential Revision: D14691704

Pulled By: soumith

fbshipit-source-id: 8c2f90596feed670976115041efed3ca071e8306

torch/nn/functional.py

index a286c22..f3d707a 100644 (file)
@@ -2771,7 +2771,7 @@ def pad(input, pad, mode='constant', value=0):
             elif mode == 'replicate':
                 ret = torch._C._nn.replication_pad1d(input, pad)
             elif mode == 'circular':
-                ret = pad_circular(input, pad)
+                ret = _pad_circular(input, pad)
             else:
                 ret = input  # TODO: remove this when jit raise supports control flow
                 raise NotImplementedError
@@ -2783,7 +2783,7 @@ def pad(input, pad, mode='constant', value=0):
             elif mode == 'replicate':
                 ret = torch._C._nn.replication_pad2d(input, pad)
             elif mode == 'circular':
-                ret = pad_circular(input, pad)
+                ret = _pad_circular(input, pad)
             else:
                 ret = input  # TODO: remove this when jit raise supports control flow
                 raise NotImplementedError
@@ -2796,7 +2796,7 @@ def pad(input, pad, mode='constant', value=0):
             elif mode == 'replicate':
                 ret = torch._C._nn.replication_pad3d(input, pad)
             elif mode == 'circular':
-                ret = pad_circular(input, pad)
+                ret = _pad_circular(input, pad)
             else:
                 ret = input  # TODO: remove this when jit raise supports control flow
                 raise NotImplementedError
@@ -3030,7 +3030,7 @@ def fold(input, output_size, kernel_size, dilation=1, padding=0, stride=1):
 
 
 @weak_script
-def pad_circular(input, padding):
+def _pad_circular(input, padding):
     # type: (Tensor, List[int]) -> Tensor
     """
     Arguments