class_docstr: Layer that computes the standard deviation across an axis of its inputs.
class_docstr_tok: ["Layer","that","computes","the","standard","deviation","across","an","axis","of","its","inputs","."]
code: def call(self, inputs):
      input_shape = tf.shape(inputs)
      ndims = len(input_shape)
  
      if self.batch_axis < 0:
          self.batch_axis = ndims + self.batch_axis
  
      # Validate axis
      if self.batch_axis >= ndims:
          raise ValueError(
              f"Invalid batch_axis. Expected 0 <= batch_axis < inputs.rank (with "
              f"inputs.rank={ndims}). Received: layer.batch_axis={self.batch_axis}"
          )
  
      if self.channel_axis < 0:
          self.channel_axis = ndims + self.channel_axis
  
      # Validate axis
      if self.channel_axis >= ndims:
          raise ValueError(
              f"Invalid channel_axis. Expected 0 <= channel_axis < inputs.rank (with "
              f"inputs.rank={ndims}). Received: layer.channel_axis={self.channel_axis}"
          )
  
      mean_stddev = self._calculate_mean_feature_standard_deviation(
          inputs, self.batch_axis
      )
      output_shape = tf.tensor_scatter_nd_update(
          input_shape, [[self.channel_axis]], [1]
      )
      outputs = tf.broadcast_to(mean_stddev, output_shape)
  
      return tf.concat([inputs, outputs], axis=self.channel_axis)
  
file_path: graphics/tensorflow_graphics/projects/gan/minibatch_standarddeviation.py
imports: import tensorflow
label_desc: Use image node_id 3 for calling the MiniBatchStandardDeviationBase obj's underlying member method code with example usage: obj.call(inputs) and returns: tf