Repository: pytorch
Issue: [ONNX] Inputs generated by onnx.export() with dynamo=False are not consistent with dynamo=True
Labels: module: onnx,triaged

### 🚀 The feature, motivation and pitch

Here, a couple of points where ONNX inputs generated by onnx.export() with dynamo=False are not consistent with dynamo=True. I think it's important to have those consistent, because for some networks, dynamo=True still does not work or produces graphs that, for example, cannot be converted to TRT.
This example illustrates 2 issues: 
1) Input names generated for dynamo/non-dynamo export, are different. Dynamo used ids from the code, while legacy export uses names of the first operation.
2) When some of the model inputs are non-tensors, they end up as inputs for ONNX graph after legacy export. With dynamo export, they are treated as constants.

```
import torch
import torch.nn as nn

class Model(nn.Module):
    def __init__(self):
        super().__init__()

    def forward(self, x, y, z, bias:float = float(0.1)):
        return x+y+z+bias

device = torch.device('cuda')
model = Model().to(device)
x = torch.rand(1024, 20, 16).to(device)
y = torch.rand(1024, 20, 16).to(device)
z = y

""""                                                                                                                                             
This results in 4-input graph with random input names, no matter if I supply bias or not:                                                        
Exported graph: graph(%onnx::Add_0 : Float(1024, 20, 16, strides=[320, 16, 1], requires_grad=0, device=cuda:0),                                  
      %onnx::Add_1 : Float(1024, 20, 16, strides=[320, 16, 1], requires_grad=0, device=cuda:0),                                                  
      %onnx::Add_2 : Float(1024, 20, 16, strides=[320, 16, 1], requires_grad=0, device=cuda:0),                                                  
      %onnx::Cast_3 : Double(requires_grad=0, device=cpu)):                                                                                      
"""
onnx_program = torch.onnx.export(model, (x, y, z, 0.2), "xyz_legacy.onnx", verbose=True)

"""                                                                                                                                              
This results in 3-input graph, no matter if I supply bias or not, using constant and source IDs correctly:                                       
graph(                                                                                                                                           
    name=main_graph,                                                                                                                             
    inputs=(                                                                                                                                     
        %"x"<FLOAT,[1024,20,16]>,                                                                                                                
        %"y"<FLOAT,[1024,20,16]>,                                                                                                                
        %"z"<FLOAT,[1024,20,16]>                                                                                                                 
    ),                                                                                                                                           
"""
onnx_program = torch.onnx.export(model, (x, y, z, 0.2), "xyz.onnx", dynamo=True, report=True)



### Alternatives

In the current situation, one has to always supply input_names to export() - that is error-prone. If one of the args in the middle is non-tensor, that would also require calling code to know if the export() ends up with legacy or dynamo export to adjust list of input names accordingly. 

### Additional context

Pytorch nightly.