"We don't have an op for aten::bitwise_and but it isn't a special case." when exporting NMS operation as ONNX.
Labels: oncall: jit, module: onnx

### 🐛 Describe the bug

Hi! I'm trying to use a detection model from ultralytics in ONNX format, but realized it does not have Non Max Suppression. I checked if I could use Pytorch to easily generate the corresponding post-procession ONNX, but it fails with a "please report a bug to PyTorch" message, so here I am :-)

```python
import torch
from torch import nn
from ultralytics.yolo.utils.ops import non_max_suppression
from ultralytics.yolo.v8.detect import DetectionPredictor

class PostProcessingModule(nn.Module, DetectionPredictor):
    def forward(self, yolo_results, iou_threshold, score_threshold):
        return non_max_suppression(
            yolo_results, iou_threshold, score_threshold
        )

if __name__ == '__main__':

    yolo_results = torch.rand([1, 14, 1000]).type(torch.float32)
    iou_threshold = 0.5
    score_threshold = 0.5
    
    t_model = PostProcessingModule()
    torch.onnx.export(
        t_model,
        (yolo_results, iou_threshold, score_threshold),
        "NMS_after.onnx",
        input_names=["yolo_results", "iou_threshold", "score_threshold"],
        output_names=["yolo_results_filtered"],
    )
```

Here's the full error message:

> RuntimeError : 0 INTERNAL ASSERT FAILED at "/opt/conda/conda-bld/pytorch_1678402412426/work/torch/csrc/jit/ir/alias_analysis.cpp":615, please report a bug to PyTorch. We don't have an op for aten::bitwise_and but it isn't a special case.  Argument types: Tensor, bool, 
> 
> Candidates:
> 	aten::bitwise_and.Tensor(Tensor self, Tensor other) -> Tensor
> 	aten::bitwise_and.Scalar(Tensor self, Scalar other) -> Tensor
> 	aten::bitwise_and.Scalar_Tensor(Scalar self, Tensor other) -> Tensor
> 	aten::bitwise_and.Tensor_out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)
> 	aten::bitwise_and.Scalar_out(Tensor self, Scalar other, *, Tensor(a!) out) -> Tensor(a!)
> 	aten::bitwise_and.Scalar_Tensor_out(Scalar self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)

### Versions

Collecting environment information...
PyTorch version: 2.0.0
Is debug build: False
CUDA used to build PyTorch: 11.8
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.2 LTS (x86_64)
GCC version: (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.35

Python version: 3.9.16 | packaged by conda-forge | (main, Feb  1 2023, 21:39:03)  [GCC 11.3.0] (64-bit runtime)
Python platform: Linux-5.15.0-69-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 11.5.119
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 2060
Nvidia driver version: 510.108.03
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture :                          x86_64
Mode(s) opératoire(s) des processeurs : 32-bit, 64-bit
Address sizes:                          39 bits physical, 48 bits virtual
Boutisme :                              Little Endian
Processeur(s) :                         12
Liste de processeur(s) en ligne :       0-11
Identifiant constructeur :              GenuineIntel
Nom de modèle :                         Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Famille de processeur :                 6
Modèle :                                158
Thread(s) par cœur :                    2
Cœur(s) par socket :                    6
Socket(s) :                             1
Révision :                              10
Vitesse maximale du processeur en MHz : 4500,0000
Vitesse minimale du processeur en MHz : 800,0000
BogoMIPS :                              5199.98
Drapaux :                               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d arch_capabilities
Virtualisation :                        VT-x
Cache L1d :                             192 KiB (6 instances)
Cache L1i :                             192 KiB (6 instances)
Cache L2 :                              1,5 MiB (6 instances)
Cache L3 :                              12 MiB (1 instance)
Nœud(s) NUMA :                          1
Nœud NUMA 0 de processeur(s) :          0-11
Vulnerability Itlb multihit:            KVM: Mitigation: Split huge pages
Vulnerability L1tf:                     Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds:                      Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown:                 Mitigation; PTI
Vulnerability Mmio stale data:          Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Retbleed:                 Mitigation; IBRS
Vulnerability Spec store bypass:        Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:               Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:               Mitigation; IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds:                    Mitigation; Microcode
Vulnerability Tsx async abort:          Not affected

Versions of relevant libraries:
[pip3] flake8==6.0.0
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.24.2
[pip3] numpydoc==1.5.0
[pip3] pytorch-lightning==2.0.0
[pip3] torch==2.0.0
[pip3] torchmetrics==0.11.4
[pip3] torchvision==0.15.0
[pip3] triton==2.0.0
[conda] blas                      1.0                         mkl    conda-forge
[conda] mkl                       2023.0.0         h6d00ec8_25399  
[conda] numpy                     1.24.2           py39h7360e5f_0    conda-forge
[conda] numpydoc                  1.5.0              pyhd8ed1ab_0    conda-forge
[conda] pytorch                   2.0.0           py3.9_cuda11.8_cudnn8.7.0_0    pytorch
[conda] pytorch-cuda              11.8                 h7e8668a_3    pytorch
[conda] pytorch-lightning         2.0.0              pyhd8ed1ab_1    conda-forge
[conda] pytorch-mutex             1.0                        cuda    pytorch
[conda] torchmetrics              0.11.4             pyhd8ed1ab_0    conda-forge
[conda] torchtriton               2.0.0                      py39    pytorch
[conda] torchvision               0.15.0               py39_cu118    pytorch

cc @EikanWang @jgong5 @wenzhe-nrv @sanchitintel