class_docstr: A framebuffer holding rasterized values required for deferred shading.
  
  Tensors are expected to have shape [batch, height, width, channels].
  
  For now, the fields are specialized for triangle rendering. Other primitives
  may be supported in the future.
  
  Immutable once created. Uses cached_property to avoid creating redundant
  tf ops when properties are accessed multiple times.
class_docstr_tok: ["A","framebuffer","holding","rasterized","values","required","for","deferred","shading",".","Tensors","are","expected","to","have","shape","[","batch",",","height",",","width",",","channels","]",".","For","now",",","the","fields","are","specialized","for","triangle","rendering",".","Other","primitives","may","be","supported","in","the","future",".","Immutable","once","created",".","Uses","cached_property","to","avoid","creating","redundant","tf","ops","when","properties","are","accessed","multiple","times","."]
docstr: Slices at the given layer index, returning a single-layer Framebuffer.
docstr_tok: ["Slices","at","the","given","layer","index",",","returning","a","single-layer","Framebuffer","."]
code: def layer(self, index):
      """Slices at the given layer index, returning a single-layer Framebuffer."""
      if not self.is_multi_layer:
          if index > 0:
              raise ValueError(
                  f"Invalid layer index {index} for single-layer Framebuffer."
              )
          return self
  
      return Framebuffer(
          triangle_id=self.triangle_id[:, index, ...],
          vertex_ids=self.vertex_ids[:, index, ...],
          foreground_mask=self.foreground_mask[:, index, ...],
          attributes={
              k: v.layer(index) for k, v in self.attributes.items()
          },
          barycentrics=self.barycentrics.layer(index),
      )
  
file_path: graphics/tensorflow_graphics/rendering/framebuffer.py
imports: import dataclasses
  from typing import Dict, Optional
  import tensorflow
label_desc: Use image node_id 9 for calling the Framebuffer obj's underlying member method code with example usage: obj.layer(index) and returns: Framebuffer, self