class_docstr: A single rasterized attribute and optionally its screen-space derivatives.
  
  Tensors are expected to have shape [batch, height, width, channels] or
  [batch, num_layers, height, width, channels].
  
  Immutable once created.
class_docstr_tok: ["A","single","rasterized","attribute","and","optionally","its","screen-space","derivatives",".","Tensors","are","expected","to","have","shape","[","batch",",","height",",","width",",","channels","]","or","[","batch",",","num_layers",",","height",",","width",",","channels","]",".","Immutable","once","created","."]
docstr: Slices at the given layer index, returning a single-layer attribute.
docstr_tok: ["Slices","at","the","given","layer","index",",","returning","a","single-layer","attribute","."]
code: def layer(self, index):
      """Slices at the given layer index, returning a single-layer attribute."""
      if not self.is_multi_layer:
          if index > 0:
              raise ValueError(
                  f"Invalid layer index {index} for single-layer RasterizedAttribute."
              )
          return self
  
      safe_layer = lambda x: x[:, index, ...] if x is not None else None
      return RasterizedAttribute(
          value=self.value[:, index, ...],
          d_dx=safe_layer(self.d_dx),
          d_dy=safe_layer(self.d_dy),
      )
  
file_path: graphics/tensorflow_graphics/rendering/framebuffer.py
imports: import dataclasses
  from typing import Dict, Optional
  import tensorflow
label_desc: Use image node_id 3 for calling the RasterizedAttribute obj's underlying member method code with example usage: obj.layer(index) and returns: RasterizedAttribute, self