Computes the "logical or" of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each entry in `axis`. If `keepdims` is true, the reduced dimensions are retained with lengt
(input_tensor,
axis=None,
keepdims=None,
name=None,
reduction_indices=None,
keep_dims=None)
| 2311 | "keep_dims is deprecated, use keepdims instead", |
| 2312 | "keep_dims") |
| 2313 | def reduce_any_v1(input_tensor, |
| 2314 | axis=None, |
| 2315 | keepdims=None, |
| 2316 | name=None, |
| 2317 | reduction_indices=None, |
| 2318 | keep_dims=None): |
| 2319 | """Computes the "logical or" of elements across dimensions of a tensor. |
| 2320 | |
| 2321 | Reduces `input_tensor` along the dimensions given in `axis`. |
| 2322 | Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each |
| 2323 | entry in `axis`. If `keepdims` is true, the reduced dimensions |
| 2324 | are retained with length 1. |
| 2325 | |
| 2326 | If `axis` is None, all dimensions are reduced, and a |
| 2327 | tensor with a single element is returned. |
| 2328 | |
| 2329 | For example: |
| 2330 | |
| 2331 | ```python |
| 2332 | x = tf.constant([[True, True], [False, False]]) |
| 2333 | tf.reduce_any(x) # True |
| 2334 | tf.reduce_any(x, 0) # [True, True] |
| 2335 | tf.reduce_any(x, 1) # [True, False] |
| 2336 | ``` |
| 2337 | |
| 2338 | Args: |
| 2339 | input_tensor: The boolean tensor to reduce. |
| 2340 | axis: The dimensions to reduce. If `None` (the default), reduces all |
| 2341 | dimensions. Must be in the range `[-rank(input_tensor), |
| 2342 | rank(input_tensor))`. |
| 2343 | keepdims: If true, retains reduced dimensions with length 1. |
| 2344 | name: A name for the operation (optional). |
| 2345 | reduction_indices: The old (deprecated) name for axis. |
| 2346 | keep_dims: Deprecated alias for `keepdims`. |
| 2347 | |
| 2348 | Returns: |
| 2349 | The reduced tensor. |
| 2350 | |
| 2351 | @compatibility(numpy) |
| 2352 | Equivalent to np.any |
| 2353 | @end_compatibility |
| 2354 | """ |
| 2355 | axis = deprecation.deprecated_argument_lookup("axis", axis, |
| 2356 | "reduction_indices", |
| 2357 | reduction_indices) |
| 2358 | keepdims = deprecation.deprecated_argument_lookup("keepdims", keepdims, |
| 2359 | "keep_dims", keep_dims) |
| 2360 | return reduce_any(input_tensor, axis, keepdims, name) |
| 2361 | |
| 2362 | |
| 2363 | @tf_export("math.reduce_any", "reduce_any", v1=[]) |
nothing calls this directly
no test coverage detected