transformers.utils.fx feature support for passes.shape_prop.ShapeProp(graph)
Author: KotaHemanthUC
Pull request: no

### System Info

Ubuntu x86_64. 

Hi Dev community, 

  I want to get intermediate tensor shape llm for given input using fx graph. 

In torch fx, we have  
   out = fx.passes.shape_prop.ShapeProp(graph)
   out.propogate(sample_input).shape


Is there similar feature capability for transformers.utils.fx ?


### Who can help?

_No response_

### Information

- [ ] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

I'm getting error:

Using symbolic_trace graph with fx.passes.passes.shape_prop.ShapeProp I'm getting

raise RuntimeError(
RuntimeError: ShapeProp error for: node=%decoder_input_ids : torch.Tensor [num_users=2] = placeholder[target=decoder_input_ids] with meta={}

### Expected behavior

Run smoothly for given fx graph , input. 

Comments:
Hi @KotaHemanthUC, thanks for raising this issue! 

This seems like an issue which is better placed in our [forums](https://discuss.huggingface.co/). We try to reserve the github issues for feature requests and bug reports.

If you believe there's a bug in the transformers library, then please provide a minimal code reproducer and full stacktrace of the error encountered. 

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.

Hi， @amyeroberts ，I meet the similar problem when use model T5-small, here is the a minimal code reproducer. 
```python
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
from torch.fx.passes.shape_prop import ShapeProp
from transformers.utils.fx import symbolic_trace

tokenizer = AutoTokenizer.from_pretrained('/yourpath/t5-small/')
model = AutoModelForSeq2SeqLM.from_pretrained("/yourpath/t5-small/")
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='np')
input_size =encoded_input['input_ids']
traced = symbolic_trace(model)
ShapeProp(traced).propagate(input_size)
```
this is some log
```
  File "t5_test.py", line 45, in <module>
    ShapeProp(traced).propagate(input_size)
  File "/root/miniconda3/envs/jrt2/lib/python3.7/site-packages/torch/fx/passes/shape_prop.py", line 152, in propagate
    return super().run(*args)
  File "/root/miniconda3/envs/jrt2/lib/python3.7/site-packages/torch/fx/interpreter.py", line 130, in run
    self.env[node] = self.run_node(node)
  File "/root/miniconda3/envs/jrt2/lib/python3.7/site-packages/torch/fx/passes/shape_prop.py", line 120, in run_node
    f"ShapeProp error for: node={n.format_node()} with "
RuntimeError: ShapeProp error for: node=%decoder_input_ids : torch.Tensor [#users=2] = placeholder[target=decoder_input_ids] with meta={}
```

Moreover, I can use the same code in gpt2，bert，llama2.

Hi @jrt-20, thanks for providing this info 

cc @fxmarty 

Gentle ping @fxmarty

cc @IlyasMoutawwakil 

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.