code: def from_srgb(
      srgb: type_alias.TensorLike, name: str = "linear_rgb_from_srgb"
  ) -> tf.Tensor:
      """Converts sRGB colors to linear colors.
  
      Note:
          In the following, A1 to An are optional batch dimensions.
  
      Args:
        srgb: A tensor of shape `[A_1, ..., A_n, 3]`, where the last dimension
          represents sRGB values.
        name: A name for this op that defaults to "linear_rgb_from_srgb".
  
      Raises:
        ValueError: If `srgb` has rank < 1 or has its last dimension not equal to 3.
  
      Returns:
        A tensor of shape `[A_1, ..., A_n, 3]`, where the last dimension represents
        RGB values in linear color space.
      """
      with tf.name_scope(name):
          srgb = tf.convert_to_tensor(value=srgb)
  
          shape.check_static(
              tensor=srgb,
              tensor_name="srgb",
              has_rank_greater_than=0,
              has_dim_equals=(-1, 3),
          )
  
          srgb = asserts.assert_all_in_range(srgb, 0.0, 1.0)
          return tf.where(
              srgb <= _K0,
              srgb / _PHI,
              ((srgb + _A) / (1 + _A)) ** _GAMMA,
          )
  
file_path: graphics/tensorflow_graphics/image/color_space/linear_rgb.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  from tensorflow_graphics.image.color_space import constants
  from tensorflow_graphics.util import asserts
  from tensorflow_graphics.util import export_api
  from tensorflow_graphics.util import shape
  from tensorflow_graphics.util import type_alias
label_desc: Use image node_id 1 for calling a global function with example usage: from_srgb(srgb, name) and returns: tf