class_docstr: Renders the Z distances of the closest face for each pixel. If no face is
  found it returns the zfar value of the camera.
  
  Output from this shader is [N, H, W, 1] since it's only depth.
  
  To use the default values, simply initialize the shader with the desired
  device e.g.
  
  .. code-block::
  
      shader = HardDepthShader(device=torch.device("cuda:0"))
class_docstr_tok: ["Renders","the","Z","distances","of","the","closest","face","for","each","pixel",".","If","no","face","is","found","it","returns","the","zfar","value","of","the","camera",".","Output","from","this","shader","is","[","N",",","H",",","W",",","1","]","since","it","'s","only","depth",".","To","use","the","default","values",",","simply","initialize","the","shader","with","the","desired","device","e.g",".","..","code-block",":",":","shader","=","HardDepthShader","(","device=torch.device","(","``","cuda:0","''",")",")"]
code: def forward(
      self, fragments: Fragments, meshes: Meshes, **kwargs
  ) -> torch.Tensor:
      cameras = super()._get_cameras(**kwargs)
  
      zfar = kwargs.get("zfar", getattr(cameras, "zfar", 100.0))
      mask = fragments.pix_to_face[..., 0:1] < 0
  
      zbuf = fragments.zbuf[..., 0:1].clone()
      zbuf[mask] = zfar
      return zbuf
  
imports: import warnings
  from typing import Optional
  import torch
  import torch.nn
  from ...common.datatypes import Device
  from ...structures.meshes import Meshes
  from ..blending import BlendParams, hard_rgb_blend, sigmoid_alpha_blend, softmax_rgb_blend
  from ..lighting import PointLights
  from ..materials import Materials
  from ..splatter_blend import SplatterBlender
  from ..utils import TensorProperties
  from .rasterizer import Fragments
  from .shading import _phong_shading_with_pixels, flat_shading, gouraud_shading, phong_shading
label_desc: Use image node_id 1 for calling the HardDepthShader obj's underlying member method code with example usage: obj.forward(fragments, meshes) and returns: zbuf