ONNX export of batch_norm for unknown channel size issue.
Labels: module: onnx, triaged

### 🐛 Describe the bug

Trying to convert https://github.com/GXYM/TextBPN-Plus-Plus into ONNX format. 
I take initial model from https://github.com/GXYM/TextBPN-Plus-Plus/blob/main/network/textnet.py

```
torch.onnx.export(model,       
     dummy_input,      
     "TextBPM_dyn.onnx",       
     export_params=True, 
     opset_version=16,    
     do_constant_folding=True,  
     input_names = ['modelInput'],   
     output_names = ['modelOutput'], 
     dynamic_axes={'modelInput' : [0, 2, 3],    
                            'modelOutput' : {0 : 'batch_size'}}) 
```

However, I face the following issue:
```
SymbolicValueError: Unsupported: ONNX export of batch_norm for unknown channel size.  [Caused by the value 'input.195 defined in (%input.195 : Float(*, *, *, strides=[720, 20, 1], requires_grad=1, device=cuda:0) = onnx::ScatterND(%903, %925, %940), scope: network.textnet_onnx.TextNet::/network.textnet_onnx.Evolution::BPN # /home/experiments/a.rogachev/TextBPN-Plus-Plus/network/layers/gcn_utils.py:102:0
)' (type 'Tensor') in the TorchScript graph. The containing node has kind 'onnx::ScatterND'.] 
    (node defined in /home/experiments/a.rogachev/TextBPN-Plus-Plus/network/layers/gcn_utils.py(102): get_node_feature
/home/experiments/a.rogachev/TextBPN-Plus-Plus/network/textnet_onnx.py(142): evolve_poly
/home/experiments/a.rogachev/TextBPN-Plus-Plus/network/textnet_onnx.py(159): forward
/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py(1176): _slow_forward
/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py(1192): _call_impl
/home/experiments/a.rogachev/TextBPN-Plus-Plus/network/textnet_onnx.py(203): forward
/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py(1176): _slow_forward
/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py(1192): _call_impl
/opt/conda/lib/python3.10/site-packages/torch/jit/_trace.py(111): wrapper
/opt/conda/lib/python3.10/site-packages/torch/jit/_trace.py(104): forward
/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py(1192): _call_impl
/opt/conda/lib/python3.10/site-packages/torch/jit/_trace.py(1183): _get_trace_graph
/opt/conda/lib/python3.10/site-packages/torch/onnx/utils.py(890): _trace_and_get_graph_from_model
/opt/conda/lib/python3.10/site-packages/torch/onnx/utils.py(967): _create_jit_graph
/opt/conda/lib/python3.10/site-packages/torch/onnx/utils.py(1108): _model_to_graph
/opt/conda/lib/python3.10/site-packages/torch/onnx/utils.py(1501): _export
/opt/conda/lib/python3.10/site-packages/torch/onnx/utils.py(512): export
/tmp/ipykernel_134/739478525.py(8): <module>
/opt/conda/lib/python3.10/site-packages/IPython/core/interactiveshell.py(3430): run_code
/opt/conda/lib/python3.10/site-packages/IPython/core/interactiveshell.py(3341): run_ast_nodes
/opt/conda/lib/python3.10/site-packages/IPython/core/interactiveshell.py(3168): run_cell_async
/opt/conda/lib/python3.10/site-packages/IPython/core/async_helpers.py(129): _pseudo_sync_runner
/opt/conda/lib/python3.10/site-packages/IPython/core/interactiveshell.py(2970): _run_cell
/opt/conda/lib/python3.10/site-packages/IPython/core/interactiveshell.py(2941): run_cell
/opt/conda/lib/python3.10/site-packages/ipykernel/zmqshell.py(540): run_cell
/opt/conda/lib/python3.10/site-packages/ipykernel/ipkernel.py(386): do_execute
/opt/conda/lib/python3.10/site-packages/ipykernel/kernelbase.py(702): execute_request
/opt/conda/lib/python3.10/site-packages/ipykernel/kernelbase.py(385): dispatch_shell
/opt/conda/lib/python3.10/site-packages/ipykernel/kernelbase.py(498): process_one
/opt/conda/lib/python3.10/site-packages/ipykernel/kernelbase.py(512): dispatch_queue
/opt/conda/lib/python3.10/asyncio/events.py(80): _run
/opt/conda/lib/python3.10/asyncio/base_events.py(1863): _run_once
/opt/conda/lib/python3.10/asyncio/base_events.py(597): run_forever
/opt/conda/lib/python3.10/site-packages/tornado/platform/asyncio.py(212): start
/opt/conda/lib/python3.10/site-packages/ipykernel/kernelapp.py(714): start
/opt/conda/lib/python3.10/site-packages/traitlets/config/application.py(990): launch_instance
/opt/conda/lib/python3.10/site-packages/ipykernel_launcher.py(12): <module>
/opt/conda/lib/python3.10/runpy.py(75): _run_code
/opt/conda/lib/python3.10/runpy.py(191): _run_module_as_main
)

    Inputs:
        #0: 903 defined in (%903 : Float(*, *, *, strides=[720, 20, 1], requires_grad=0, device=cuda:0) = onnx::Cast[to=1](%901), scope: network.textnet_onnx.TextNet::/network.textnet_onnx.Evolution::BPN # /home/experiments/a.rogachev/TextBPN-Plus-Plus/network/layers/gcn_utils.py:99:0
    )  (type 'Tensor')
        #1: 925 defined in (%925 : Long(*, 3, device=cpu) = onnx::Transpose[perm=[1, 0]](%924), scope: network.textnet_onnx.TextNet::/network.textnet_onnx.Evolution::BPN # /home/experiments/a.rogachev/TextBPN-Plus-Plus/network/layers/gcn_utils.py:102:0
    )  (type 'Tensor')
        #2: 940 defined in (%940 : Float(*, device=cpu) = onnx::Slice(%927, %934, %936, %939), scope: network.textnet_onnx.TextNet::/network.textnet_onnx.Evolution::BPN # /home/experiments/a.rogachev/TextBPN-Plus-Plus/network/layers/gcn_utils.py:102:0
    )  (type 'Tensor')
    Outputs:
        #0: input.195 defined in (%input.195 : Float(*, *, *, strides=[720, 20, 1], requires_grad=1, device=cuda:0) = onnx::ScatterND(%903, %925, %940), scope: network.textnet_onnx.TextNet::/network.textnet_onnx.Evolution::BPN # /home/experiments/a.rogachev/TextBPN-Plus-Plus/network/layers/gcn_utils.py:102:0
    )  (type 'Tensor')
```

Looks like the problem happens with the [BPN](https://github.com/GXYM/TextBPN-Plus-Plus/blob/5b535bd43bf2bb188793f4fb545a23fe075ecdcb/network/textnet.py#L209) part.


### Versions

OS: Ubuntu 18.04.6 LTS (x86_64)
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Clang version: Could not collect
CMake version: version 3.22.1
Libc version: glibc-2.27

Python version: 3.10.8 (main, Nov  4 2022, 13:48:29) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-3.10.0-1160.76.1.el7.x86_64-x86_64-with-glibc2.27
Is CUDA available: True
CUDA runtime version: 11.6.124
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: 
GPU 0: Tesla T4
GPU 1: Tesla T4
GPU 2: Tesla T4
GPU 3: Tesla T4

Nvidia driver version: 470.63.01
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.4.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.4.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.4.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.4.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.4.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.4.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.4.0
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.24.1
[pip3] torch==1.13.1
[pip3] torchelastic==0.2.2
[pip3] torchtext==0.14.1
[pip3] torchvision==0.14.1
[conda] blas                      1.0                         mkl  
[conda] ffmpeg                    4.3                  hf484d3e_0    pytorch
[conda] mkl                       2021.4.0           h06a4308_640  
[conda] mkl-service               2.4.0           py310h7f8727e_0  
[conda] mkl_fft                   1.3.1           py310hd6ae3a3_0  
[conda] mkl_random                1.2.2           py310h00e6091_0  
[conda] numpy                     1.22.3          py310hfa59a62_0  
[conda] numpy-base                1.22.3          py310h9585f30_0  
[conda] pytorch                   1.13.1          py3.10_cuda11.6_cudnn8.3.2_0    pytorch
[conda] pytorch-cuda              11.6                 h867d48c_1    pytorch
[conda] pytorch-mutex             1.0                        cuda    pytorch
[conda] torchelastic              0.2.2                    pypi_0    pypi
[conda] torchtext                 0.14.1                    py310    pytorch
[conda] torchvision               0.14.1              py310_cu116    pytorch