docstr: Returns:
code: def forward(
      self,
      pixel_values: Optional[torch.FloatTensor] = None,
      output_attentions: Optional[bool] = None,
      output_hidden_states: Optional[bool] = None,
      interpolate_pos_encoding: Optional[bool] = False,
      return_dict: Optional[bool] = None,
  ) -> Union[Tuple, BaseModelOutputWithPooling]:
      r"""
      Returns:
  
      """
      output_attentions = (
          output_attentions
          if output_attentions is not None
          else self.config.output_attentions
      )
      output_hidden_states = (
          output_hidden_states
          if output_hidden_states is not None
          else self.config.output_hidden_states
      )
      return_dict = (
          return_dict
          if return_dict is not None
          else self.config.use_return_dict
      )
  
      if pixel_values is None:
          raise ValueError("You have to specify pixel_values")
  
      hidden_states = self.embeddings(
          pixel_values,
          interpolate_pos_encoding=interpolate_pos_encoding,
      )
      hidden_states = self.pre_layrnorm(hidden_states)
  
      encoder_outputs = self.encoder(
          inputs_embeds=hidden_states,
          output_attentions=output_attentions,
          output_hidden_states=output_hidden_states,
          return_dict=return_dict,
      )
  
      last_hidden_state = encoder_outputs[0]
      pooled_output = last_hidden_state[:, 0, :]
      pooled_output = self.post_layernorm(pooled_output)
  
      if not return_dict:
          return (last_hidden_state, pooled_output) + encoder_outputs[
              1:
          ]
  
      return BaseModelOutputWithPooling(
          last_hidden_state=last_hidden_state,
          pooler_output=pooled_output,
          hidden_states=encoder_outputs.hidden_states,
          attentions=encoder_outputs.attentions,
      )
  
imports: import math
  from dataclasses import dataclass
  from typing import Optional, Tuple, Union
  import torch
  import torch.utils.checkpoint
  from torch import nn
  from ...activations import ACT2FN
  from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPooling
  from ...utils import ModelOutput, logging
  from .configuration_idefics import IdeficsVisionConfig
label_desc: Use image node_id 2 for calling the IdeficsVisionTransformer obj's underlying member method code with example usage: obj.forward(pixel_values, output_attentions, output_hidden_states, interpolate_pos_encoding, return_dict) and returns: BaseModelOutputWithPooling, unknown