class_docstr: Correlation Cost Layer.
  
  This layer implements the correlation operation from [FlowNet Learning
  Optical Flow with Convolutional Networks](https://arxiv.org/abs/1504.06852)(Fischer et al.).
  
  Args:
      kernel_size: An integer specifying the height and width of the
          patch used to compute the per-patch costs.
      max_displacement: An integer specifying the maximum search radius
          for each position.
      stride_1: An integer specifying the stride length in the input.
      stride_2: An integer specifying the stride length in the patch.
      pad: An integer specifying the paddings in height and width.
      data_format: Specifies the data format.
          Possible values are:
              "channels_last" float [batch, height, width, channels]
              "channels_first" float [batch, channels, height, width]
              Defaults to `"channels_last"`.
code: def __init__(
      self,
      kernel_size: int,
      max_displacement: int,
      stride_1: int,
      stride_2: int,
      pad: int,
      data_format: str,
      **kwargs,
  ):
      self.kernel_size = kernel_size
      self.max_displacement = max_displacement
      self.stride_1 = stride_1
      self.stride_2 = stride_2
      self.pad = pad
  
      if (
          data_format != "channels_last"
          and data_format != "channels_first"
      ):
          raise ValueError(
              "`data_format` must be either `channels_last` or"
              "`channels_first`, instead got %s" % data_format
          )
  
      self.data_format = data_format
  
      super().__init__(**kwargs)
  
file_path: addons/tensorflow_addons/layers/optical_flow.py
imports: import tensorflow
  from typeguard import typechecked
  from tensorflow_addons.utils.resource_loader import LazySO
label_desc: Use image node_id 1 to create a new CorrelationCost object from inherited base classes: tf.keras.layers with example: obj = CorrelationCost(kernel_size, max_displacement, stride_1, stride_2, pad, data_format)