If you check the other “canned” constrains you can see that you need to just manipulate the weights that are not respecting your constrain.
In your case I suggest to check this implementation as a baseline to retrieve the indexes of the weights that you want to manipulate:
  

      github.com
  

  
    tensorflow/tensorflow/blob/v2.7.0/tensorflow/python/ops/check_ops.py#L2108-L2148 2



      
      
          @tf_export(
              'math.is_strictly_increasing',
              v1=[
                  'math.is_strictly_increasing', 'debugging.is_strictly_increasing',
                  'is_strictly_increasing'
              ])
          @dispatch.add_dispatch_support
          @deprecation.deprecated_endpoints('debugging.is_strictly_increasing',
                                            'is_strictly_increasing')
          def is_strictly_increasing(x, name=None):
            """Returns `True` if `x` is strictly increasing.
          
          
  Elements of `x` are compared in row-major order.  The tensor `[x[0],...]`
            is strictly increasing if for every adjacent pair we have `x[i] < x[i+1]`.
            If `x` has less than two elements, it is trivially strictly increasing.
          
          
  See also:  `is_non_decreasing`
          
          
  >>> x1 = tf.constant([1.0, 2.0, 3.0])
            >>> tf.math.is_strictly_increasing(x1)
      
    
  

  This file has been truncated. show original