NotImplementedError: The operator 'aten::upsample_nearest1d.out' is not current implemented for the MPS device
Labels: triaged, module: mps

## Issue description

It seems nn.Upsample(scale_factor=self.upsample_kernels[k]) has not implemented for M1 

Provide a short description.

I have created an encoder and decoder model in the decoding part for upsampling I have used nn.Upsample(). It is working in CUDA environment but not working in M1 

## Code example

filters=[128*2, 64*2, 32*2, 16*2]
upsample_kernels=[1, 2, 2, 2]
in_channels=512
out_channels=3
upsamples = nn.ModuleList([nn.Sequential(
            nn.Upsample(scale_factor=upsample_kernels[k]),
            ConvBNReLU(
                in_channels=in_channels if k == 0 else filters[k - 1],
                out_channels=filters[k],
                kernel_size=kernel_size,
                activation='relu',
            )
        ) for k in range(4)])
class ConvBNReLU(nn.Module):
    def __init__(self, in_channels=5, out_channels=5, kernel_size=3, dilation=1, activation="relu"):
        super().__init__()
        self.in_channels = in_channels
        self.out_channels = out_channels
        self.kernel_size = kernel_size
        self.dilation = dilation
        self.activation = activation
        self.padding = (self.kernel_size + (self.kernel_size - 1) * (self.dilation - 1) - 1) // 2
        self.layers = nn.Sequential(
            nn.ConstantPad1d(padding=(self.padding, self.padding), value=0),
            nn.Conv1d(
                in_channels=self.in_channels,
                out_channels=self.out_channels,
                kernel_size=self.kernel_size,
                dilation=self.dilation,
                bias=True,
            ),
            nn.ReLU(),
            nn.BatchNorm1d(self.out_channels),
        )
        nn.init.xavier_uniform_(self.layers[1].weight)
        nn.init.zeros_(self.layers[1].bias)

    def forward(self, x):
        return self.layers(x)

Please try to provide a minimal example to repro the bug.
Error messages and stack traces are also helpful.


NotImplementedError                       Traceback (most recent call last)
Input In [21], in <cell line: 1>()
----> 1 model, loss_tracking = doormodeltraining.Train_The_Model(model, trainLoader, valLoader, criterion, DEVICE, opt, scheduler, wandb, epoches=epoches, min=min_, max=max_, )

File ~/Documents/pytorchGPUM1/doorstuff/doormodeltraining.py:72, in Train_The_Model(model, trainLoader, valLoader, criterion, DEVICE, opt, scheduler, wandb, epoches, min, max, is_dim)
     70 x= x.to(DEVICE)
     71 Y = Y.to(DEVICE)
---> 72 pred = model(x)
     73 #print(pred.shape)
     74 #loss = criterion(pred, Y)
     75 opt.zero_grad()

File ~/opt/anaconda3/envs/m1torch/lib/python3.9/site-packages/torch/nn/modules/module.py:1130, in Module._call_impl(self, *input, **kwargs)
   1126 # If we don't have any hooks, we want to skip the rest of the logic in
   1127 # this function, and just call forward.
   1128 if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
   1129         or _global_forward_hooks or _global_forward_pre_hooks):
-> 1130     return forward_call(*input, **kwargs)
   1131 # Do not call functions when jit is used
   1132 full_backward_hooks, non_full_backward_hooks = [], []

File ~/Documents/pytorchGPUM1/doorstuff/models.py:462, in custUtime.forward(self, x)
    460 # print(x1.shape)
    461  x=torch.cat((x,x1), 1)
--> 462  x = self.decoder(x, shortcuts, shortcuts2 )
    463  x = self.conv1(x)
    464  x= self.conv2(x)

File ~/opt/anaconda3/envs/m1torch/lib/python3.9/site-packages/torch/nn/modules/module.py:1130, in Module._call_impl(self, *input, **kwargs)
   1126 # If we don't have any hooks, we want to skip the rest of the logic in
   1127 # this function, and just call forward.
   1128 if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
   1129         or _global_forward_hooks or _global_forward_pre_hooks):
-> 1130     return forward_call(*input, **kwargs)
   1131 # Do not call functions when jit is used
   1132 full_backward_hooks, non_full_backward_hooks = [], []

File ~/Documents/pytorchGPUM1/doorstuff/models.py:298, in Decoder.forward(self, z, shortcuts, shortcuts2)
    294 i=0
    296 for upsample, block, shortcut1, shortcut2  in zip(self.upsamples, self.blocks, shortcuts[::-1], shortcuts[::-1]):
    297   #  print("z before upsample ", z.shape)
--> 298     z = upsample(z)
    299  #   print("z after upsample " , z.shape)
    300  #   print("shortcut shape ", shortcut1.shape)
    301  #   print("shortcut2 shape ", shortcut2.shape)
    302     z = torch.cat([shortcut1, shortcut2, z], dim=1)

File ~/opt/anaconda3/envs/m1torch/lib/python3.9/site-packages/torch/nn/modules/module.py:1130, in Module._call_impl(self, *input, **kwargs)
   1126 # If we don't have any hooks, we want to skip the rest of the logic in
   1127 # this function, and just call forward.
   1128 if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
   1129         or _global_forward_hooks or _global_forward_pre_hooks):
-> 1130     return forward_call(*input, **kwargs)
   1131 # Do not call functions when jit is used
   1132 full_backward_hooks, non_full_backward_hooks = [], []

File ~/opt/anaconda3/envs/m1torch/lib/python3.9/site-packages/torch/nn/modules/container.py:139, in Sequential.forward(self, input)
    137 def forward(self, input):
    138     for module in self:
--> 139         input = module(input)
    140     return input

File ~/opt/anaconda3/envs/m1torch/lib/python3.9/site-packages/torch/nn/modules/module.py:1130, in Module._call_impl(self, *input, **kwargs)
   1126 # If we don't have any hooks, we want to skip the rest of the logic in
   1127 # this function, and just call forward.
   1128 if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
   1129         or _global_forward_hooks or _global_forward_pre_hooks):
-> 1130     return forward_call(*input, **kwargs)
   1131 # Do not call functions when jit is used
   1132 full_backward_hooks, non_full_backward_hooks = [], []

File ~/opt/anaconda3/envs/m1torch/lib/python3.9/site-packages/torch/nn/modules/upsampling.py:153, in Upsample.forward(self, input)
    152 def forward(self, input: Tensor) -> Tensor:
--> 153     return F.interpolate(input, self.size, self.scale_factor, self.mode, self.align_corners,
    154                          recompute_scale_factor=self.recompute_scale_factor)

File ~/opt/anaconda3/envs/m1torch/lib/python3.9/site-packages/torch/nn/functional.py:3908, in interpolate(input, size, scale_factor, mode, align_corners, recompute_scale_factor, antialias)
   3905     raise ValueError("Anti-alias option is only supported for bilinear and bicubic modes")
   3907 if input.dim() == 3 and mode == "nearest":
-> 3908     return torch._C._nn.upsample_nearest1d(input, output_size, scale_factors)
   3909 if input.dim() == 4 and mode == "nearest":
   3910     return torch._C._nn.upsample_nearest2d(input, output_size, scale_factors)

NotImplementedError: The operator 'aten::upsample_nearest1d.out' is not current implemented for the MPS device. If you want this op to be added in priority during the prototype phase of this feature, please comment on https://github.com/pytorch/pytorch/issues/77764. As a temporary fix, you can set the environment variable `PYTORCH_ENABLE_MPS_FALLBACK=1` to use the CPU as a fallback for this op. WARNING: this will be slower than running natively on MPS.

## System Info
Please copy and paste the output from our
[environment collection script](https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py)
(or fill out the checklist below manually).

You can get the script and run it with:
```
wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
```

- PyTorch or Caffe2:
- How you installed PyTorch (conda, pip, source):
- Build command you used (if compiling from source):
- OS:
- PyTorch version:
- Python version:
- CUDA/cuDNN version:
- GPU models and configuration:
- GCC version (if compiling from source):
- CMake version:
- Versions of any other relevant libraries:


cc @kulinseth @albanD @malfet @DenisVieriu97 @razarmehr @abhudev