When input the same image, in Google ViT model output.last_hidden_state is not equal to output.hidden_states[-1] ? I tried in Bert, the outputs are the same.
feature_extractor = ViTFeatureExtractor.from_pretrained('google/vit-base-patch16-224-in21k')
model = ViTModel.from_pretrained('google/vit-base-patch16-224-in21k')
inputs = feature_extractor(images=[image], return_tensors="pt")
outputs = model(pixel_values=inputs['pixel_values'], output_hidden_states=True)
vec1 = outputs.hidden_states[-1][0, 0, :]
vec2 = outputs.last_hidden_state[0, 0, :]
in my mind, vec1 should be the same as vec2. But the fact is they are not the same at all.