Repository: pytorch
Issue: nn.Sequential causes fx.replace_pattern to not find any match. 
Labels: triaged,module: fx

### 🐛 Describe the bug

Having nn.Sequential (.e.g., torchvision resnet50 model has it) in the model code causes fx.replace_pattern to not find any matches. However, it does find a match if nn.Sequential is removed. Overall, I am looking for a way to match all Bottleneck patterns in the resnet50 model. 

The following code results in no matches. 

```
import torch
import torch.nn as nn
from torchvision import models
from torch.fx import symbolic_trace, replace_pattern

class replacement_pattern(nn.Module):
    def __init__(self):
        super().__init__()

    def forward(self, x):
        return x

# no matching pattern found with Sequential
mod = nn.Sequential(models.resnet.Bottleneck(2048, 512))

# The following works
#mod = models.resnet.Bottleneck(2048, 512)

traced = symbolic_trace(mod)

pattern = models.resnet.Bottleneck(2048, 512)

rep_pattern = replacement_pattern()

matches = replace_pattern(traced, pattern, rep_pattern)

print(f"matches: {matches}")
"""
matches: []
"""
```

I think the reason is the presence of "target" match in https://github.com/pytorch/pytorch/blob/master/torch/fx/subgraph_rewriter.py#L59 and for nn.Sequential the target is different. See below. 


```
traced.graph.print_tabular()
"""
opcode         name       target                   args               kwargs
-------------  ---------  -----------------------  -----------------  --------
placeholder    input_1    input                    ()                 {}
call_module    _0_conv1   0.conv1                  (input_1,)         {}
call_module    _0_bn1     0.bn1                    (_0_conv1,)        {}
call_module    _0_relu    0.relu                   (_0_bn1,)          {}
call_module    _0_conv2   0.conv2                  (_0_relu,)         {}
call_module    _0_bn2     0.bn2                    (_0_conv2,)        {}
call_module    _0_relu_1  0.relu                   (_0_bn2,)          {}
call_module    _0_conv3   0.conv3                  (_0_relu_1,)       {}
call_module    _0_bn3     0.bn3                    (_0_conv3,)        {}
call_function  add        <built-in function add>  (_0_bn3, input_1)  {}
call_module    _0_relu_2  0.relu                   (add,)             {}
output         output     output                   (_0_relu_2,)       {}
"""
```

```
symbolic_trace(pattern).graph.print_tabular()
"""
opcode         name    target                   args       kwargs
-------------  ------  -----------------------  ---------  --------
placeholder    x       x                        ()         {}
call_module    conv1   conv1                    (x,)       {}
call_module    bn1     bn1                      (conv1,)   {}
call_module    relu    relu                     (bn1,)     {}
call_module    conv2   conv2                    (relu,)    {}
call_module    bn2     bn2                      (conv2,)   {}
call_module    relu_1  relu                     (bn2,)     {}
call_module    conv3   conv3                    (relu_1,)  {}
call_module    bn3     bn3                      (conv3,)   {}
call_function  add     <built-in function add>  (bn3, x)   {}
call_module    relu_2  relu                     (add,)     {}
output         output  output                   (relu_2,)  {}
"""
```



### Versions

PyTorch version: 1.11.0+cu113
Is debug build: False
CUDA used to build PyTorch: 11.3
ROCM used to build PyTorch: N/A

OS: Ubuntu 18.04.5 LTS (x86_64)
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Clang version: Could not collect
CMake version: version 3.10.2
Libc version: glibc-2.27

Python version: 3.8.12 (default, Sep 10 2021, 00:16:05)  [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-5.4.0-107-generic-x86_64-with-glibc2.27
Is CUDA available: True
CUDA runtime version: 11.1.105
GPU models and configuration:
GPU 0: NVIDIA A100-SXM4-40GB
GPU 1: NVIDIA A100-SXM4-40GB

Nvidia driver version: 510.47.03
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.0.5
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] numpy==1.22.4
[pip3] torch==1.11.0+cu113
[pip3] torchaudio==0.11.0+cu113
[pip3] torchvision==0.12.0+cu113
[conda] Could not collect