# Hidden\_states Transformers for computer vision

**URL:** <https://discuss.huggingface.co/t/hidden-states-transformers-for-computer-vision/20683>\
**Category:** 🤗Transformers\
**Created:** [July 21, 2022, 12:56pm UTC](https://discuss.huggingface.co/t/hidden-states-transformers-for-computer-vision/20683 "2022-07-21T12:56:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kanlions](https://avatars.discourse-cdn.com/v4/letter/k/5daacb/32.png) [@kanlions](https://discuss.huggingface.co/u/kanlions)\
**Post date:** [July 21, 2022, 12:56pm UTC](https://discuss.huggingface.co/t/hidden-states-transformers-for-computer-vision/20683/1 "2022-07-21T12:56:19Z")

</div>

Hi all,  
I am having trouble in interpreting the hidden\_state and last\_hidden\_state indexing with respect to transformer models for computer vision

which layer output is the last\_hidden state. Example in a swin transformer tiny the hidden\_state returns a tuple of 5 with sizes 3136x96, 784x192, 196x38, 49x768 and 49x768 respectively. I tried to view them but I was not able to get the last\_hidden\_state from the tuples of hidden\_state.  
Similar problem I faced in VIT models too  
Please can anyone help in understanding these embeddings from Model output class specially for transformers of computer vision as I am trying to find some interpretibility from the model outputs.

Thanks in advanced
