class_docstr: Network for monocular depth estimation.
      
docstr: Forward pass.
  
  Args:
      x (tensor): input data (image)
  
  Returns:
      tensor: depth
code: def forward(self, x):
      """Forward pass.
  
      Args:
          x (tensor): input data (image)
  
      Returns:
          tensor: depth
      """
      if self.channels_last == True:
          print("self.channels_last = ", self.channels_last)
          x.contiguous(memory_format=torch.channels_last)
  
      layer_1 = self.pretrained.layer1(x)
      layer_2 = self.pretrained.layer2(layer_1)
      layer_3 = self.pretrained.layer3(layer_2)
      layer_4 = self.pretrained.layer4(layer_3)
  
      layer_1_rn = self.scratch.layer1_rn(layer_1)
      layer_2_rn = self.scratch.layer2_rn(layer_2)
      layer_3_rn = self.scratch.layer3_rn(layer_3)
      layer_4_rn = self.scratch.layer4_rn(layer_4)
  
      path_4 = self.scratch.refinenet4(layer_4_rn)
      path_3 = self.scratch.refinenet3(path_4, layer_3_rn)
      path_2 = self.scratch.refinenet2(path_3, layer_2_rn)
      path_1 = self.scratch.refinenet1(path_2, layer_1_rn)
  
      out = self.scratch.output_conv(path_1)
  
      return torch.squeeze(out, dim=1)
  
file_path: lavis/lavis/common/annotator/midas/midas/midas_net_custom.py
imports: import torch
  import torch.nn
  from .base_model import BaseModel
  from .blocks import FeatureFusionBlock, FeatureFusionBlock_custom, Interpolate, _make_encoder
label_desc: Use image node_id 2 for calling the MidasNet_small obj's underlying member method code with example usage: obj.forward(x) and returns: torch