text: Title: Add support for optional raise in the CHECK API
  Body: ```python
  if KORNIA_CHECK_IS_GRAY(guidance, raise=False):
      ...
  ```
  
  _Originally posted by @johnnv1 in https://github.com/kornia/kornia/pull/2322#discussion_r1167259191_
              