code: def l2_loss(prediction, target, weights=1.0):
      """L2 loss implementation that forces same prediction and target shapes."""
      assert (
          prediction.shape == target.shape
      ), "Shape dims should be the same."
      return tf.reduce_mean(weights * tf.square(target - prediction))
  
file_path: graphics/tensorflow_graphics/projects/radiance_fields/utils.py
imports: import math
  import tensorflow
  from tensorflow_graphics.geometry.transformation import rotation_matrix_3d
  from tensorflow_graphics.util import shape
label_desc: Use image node_id 7 for calling a global function with example usage: l2_loss(prediction, target, weights) and returns: tf