class_docstr: Constrains `Conv2D` kernel weights to be the same for each radius.
  
  Also available via the shortcut function
  `tf.keras.constraints.radial_constraint`.
  
  For example, the desired output for the following 4-by-4 kernel:
  
  ```
      kernel = [[v_00, v_01, v_02, v_03],
                [v_10, v_11, v_12, v_13],
                [v_20, v_21, v_22, v_23],
                [v_30, v_31, v_32, v_33]]
  ```
  
  is this::
  
  ```
      kernel = [[v_11, v_11, v_11, v_11],
                [v_11, v_33, v_33, v_11],
                [v_11, v_33, v_33, v_11],
                [v_11, v_11, v_11, v_11]]
  ```
  
  This constraint can be applied to any `Conv2D` layer version, including
  `Conv2DTranspose` and `SeparableConv2D`, and with either `"channels_last"` or
  `"channels_first"` data format. The method assumes the weight tensor is of
  shape `(rows, cols, input_depth, output_depth)`.
docstr: Radially constraints a kernel with shape (height, width, channels).
docstr_tok: ["Radially","constraints","a","kernel","with","shape","(","height",",","width",",","channels",")","."]
code: def _kernel_constraint(self, kernel):
      """Radially constraints a kernel with shape (height, width, channels)."""
      padding = backend.constant([[1, 1], [1, 1]], dtype="int32")
  
      kernel_shape = backend.shape(kernel)[0]
      start = backend.cast(kernel_shape / 2, "int32")
  
      kernel_new = backend.switch(
          backend.cast(math_ops.floormod(kernel_shape, 2), "bool"),
          lambda: kernel[start - 1 : start, start - 1 : start],
          lambda: kernel[start - 1 : start, start - 1 : start]
          + backend.zeros(  # pylint: disable=g-long-lambda
              (2, 2), dtype=kernel.dtype
          ),
      )
      index = backend.switch(
          backend.cast(math_ops.floormod(kernel_shape, 2), "bool"),
          lambda: backend.constant(0, dtype="int32"),
          lambda: backend.constant(1, dtype="int32"),
      )
      while_condition = lambda index, *args: backend.less(index, start)
  
      def body_fn(i, array):
          return i + 1, array_ops.pad(
              array,
              padding,
              constant_values=kernel[start + i, start + i],
          )
  
      _, kernel_new = while_loop.while_loop(
          while_condition,
          body_fn,
          [index, kernel_new],
          shape_invariants=[
              index.get_shape(),
              tensor_shape.TensorShape([None, None]),
          ],
      )
      return kernel_new
  
imports: from tensorflow.python.framework import tensor_shape
  from tensorflow.python.keras import backend
  from tensorflow.python.keras.utils.generic_utils import deserialize_keras_object
  from tensorflow.python.keras.utils.generic_utils import serialize_keras_object
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import array_ops_stack
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import while_loop
  from tensorflow.tools.docs import doc_controls
label_desc: Use image node_id 2 for calling the RadialConstraint obj's underlying member method code with example usage: obj._kernel_constraint(kernel) and returns: kernel_new, unknown,  array_ops