Bitwise reduction (logical OR). Arguments: x: Tensor or variable. axis: axis along which to perform the reduction. keepdims: whether the drop or broadcast the reduction axes. Returns: A uint8 tensor (0s and 1s).
(x, axis=None, keepdims=False)
| 2005 | |
| 2006 | @keras_export('keras.backend.any') |
| 2007 | def any(x, axis=None, keepdims=False): |
| 2008 | """Bitwise reduction (logical OR). |
| 2009 | |
| 2010 | Arguments: |
| 2011 | x: Tensor or variable. |
| 2012 | axis: axis along which to perform the reduction. |
| 2013 | keepdims: whether the drop or broadcast the reduction axes. |
| 2014 | |
| 2015 | Returns: |
| 2016 | A uint8 tensor (0s and 1s). |
| 2017 | """ |
| 2018 | x = math_ops.cast(x, dtypes_module.bool) |
| 2019 | return math_ops.reduce_any(x, axis, keepdims) |
| 2020 | |
| 2021 | |
| 2022 | @keras_export('keras.backend.all') |