Home
last modified time | relevance | path

Searched full:count_nonzero (Results 1 – 25 of 68) sorted by relevance

123

/aosp_15_r20/external/pytorch/test/torch_np/numpy_tests/core/
H A Dtest_numeric.py144 out = np.count_nonzero(arr, axis=1)
1029 assert np.count_nonzero(lst) == 5
1030 assert_array_equal(np.count_nonzero(lst, axis=0), np.array([1, 1, 1, 2]))
1031 assert_array_equal(np.count_nonzero(lst, axis=1), np.array([3, 2]))
1034 assert_equal(np.count_nonzero(np.array([])), 0)
1035 assert_equal(np.count_nonzero(np.array([], dtype="?")), 0)
1038 assert_equal(np.count_nonzero(np.array([0])), 0)
1039 assert_equal(np.count_nonzero(np.array([0], dtype="?")), 0)
1042 assert_equal(np.count_nonzero(np.array([1])), 1)
1043 assert_equal(np.count_nonzero(np.array([1], dtype="?")), 1)
[all …]
H A Dtest_multiarray.py1037 assert_equal(np.count_nonzero(d), 0)
1043 assert_equal(np.count_nonzero(d), 0)
1048 assert_equal(np.count_nonzero(d), 0)
1053 assert_equal(np.count_nonzero(d), 0)
1071 assert_equal(np.count_nonzero(d), 0)
1346 assert_equal(np.count_nonzero(a), c)
1349 assert_equal(np.count_nonzero(a), c)
1351 assert_equal(np.count_nonzero(a), c)
1353 assert_equal(np.count_nonzero(a), c)
1371 assert_equal(np.count_nonzero(a), builtins.sum(a.tolist()))
[all …]
/aosp_15_r20/external/tensorflow/tensorflow/python/debug/lib/
H A Ddebug_events_monitors.py174 num_neg_inf = np.count_nonzero(
176 num_pos_inf = np.count_nonzero(
178 num_nan = np.count_nonzero(np.isnan(tensor_value))
/aosp_15_r20/external/pytorch/test/distributed/_composable/fsdp/
H A Dtest_fully_shard_clip_grad_norm_.py81 if torch.count_nonzero(grad):
87 if torch.count_nonzero(grad):
H A Dtest_fully_shard_state_dict.py173 self.assertEqual(torch.count_nonzero(tensor.to_local()).item(), 0)
/aosp_15_r20/external/tensorflow/tensorflow/python/ops/
H A Dmath_ops.py2372 @tf_export(v1=["math.count_nonzero", "count_nonzero"])
2380 def count_nonzero(input_tensor=None, function
2406 tf.math.count_nonzero(x) # 3
2407 tf.math.count_nonzero(x, 0) # [1, 2, 0]
2408 tf.math.count_nonzero(x, 1) # [1, 2]
2409 tf.math.count_nonzero(x, 1, keepdims=True) # [[1], [2]]
2410 tf.math.count_nonzero(x, [0, 1]) # 3
2419 tf.math.count_nonzero(x) # 3, with "a", " ", and "b" as nonzero strings.
2450 @tf_export("math.count_nonzero", v1=[])
2476 tf.math.count_nonzero(x) # 3
[all …]
/aosp_15_r20/external/pytorch/torch/testing/_internal/
H A Dcommon_subclass.py89 … if isinstance(e, torch.Tensor) and e.ndim == 2 and e.count_nonzero() == e.diag().count_nonzero():
/aosp_15_r20/external/pytorch/torch/_numpy/
H A D_reductions_impl.py67 def count_nonzero(a: ArrayLike, axis: AxisLike = None, *, keepdims: KeepDims = False): function
68 return a.count_nonzero(axis)
/aosp_15_r20/external/pytorch/aten/src/ATen/native/mps/operations/
H A DIndexing.mm28 #include <ATen/ops/count_nonzero.h>
230 int64_t total_nonzero = at::count_nonzero(self).item<int64_t>();
322 int64_t total_nonzero = at::count_nonzero(self).item<int64_t>();
H A DReduceOps.mm58 COUNT_NONZERO,
242 } else if (reduction_type == MPSReductionType::COUNT_NONZERO) {
1015 MPSReductionType::COUNT_NONZERO,
/aosp_15_r20/external/pytorch/test/torch_np/
H A Dtest_reductions.py305 np.count_nonzero,
318 np.count_nonzero,
/aosp_15_r20/external/tensorflow/tensorflow/tools/compatibility/
H A Dall_renames_v2.py276 "tf.count_nonzero":
277 "tf.math.count_nonzero",
H A Dtf_upgrade_v2_test.py1009 "tf.math.count_nonzero(input_tensor=input, dtype=dtype, name=name, "
1014 "tf.math.count_nonzero(input=input, dtype=dtype, name=name, "
1021 "tf.count_nonzero(input_tensor=input, dtype=dtype, name=name, "
1026 "tf.math.count_nonzero(input=input, dtype=dtype, name=name, "
H A Dtf_upgrade.py33 "tf.count_nonzero": {
/aosp_15_r20/external/tensorflow/tensorflow/python/ops/numpy_ops/
H A Dnp_math_ops.py1163 @np_utils.np_doc('count_nonzero')
1164 def count_nonzero(a, axis=None): function
1165 return math_ops.count_nonzero(np_array_ops.array(a), axis)
/aosp_15_r20/external/tensorflow/tensorflow/python/kernel_tests/math_ops/
H A Dreduction_ops_test.py1091 tf_ans = math_ops.count_nonzero(x, reduction_axes, keepdims)
1152 y = math_ops.count_nonzero(x, [0])
1158 v = math_ops.count_nonzero(constant_op.constant(["test"]))
/aosp_15_r20/external/libopus/dnn/torch/osce/utils/
H A Dmisc.py48 count = torch.count_nonzero(p).item()
/aosp_15_r20/external/pytorch/functorch/dim/
H A D__init__.py127 _def("count_nonzero")
/aosp_15_r20/external/tensorflow/tensorflow/lite/experimental/acceleration/mini_benchmark/metrics/
H A Dblazeface_metrics.py85 tf.math.count_nonzero(high_scoring_indices, dtype=tf.float32), 1.0))
/aosp_15_r20/external/pytorch/functorch/op_analysis/
H A Dpublic_api526 count_nonzero
H A Dannotated_ops82 count_nonzero, reduction
/aosp_15_r20/external/pytorch/test/mobile/model_test/
H A Dcoverage.yaml161 - aten::count_nonzero
784 aten::count_nonzero: 4
/aosp_15_r20/external/tensorflow/tensorflow/python/ops/numpy_ops/integration_test/benchmarks/
H A Dmicro_benchmarks.py132 self._benchmark_np_and_tf_np_unary('count_nonzero')
/aosp_15_r20/external/pytorch/test/distributed/_composable/fully_shard/
H A Dtest_fully_shard_model_checkpoint.py133 if torch.count_nonzero(tensor) == 0:
/aosp_15_r20/external/executorch/examples/apple/coreml/scripts/
H A Dinspector_utils.py394 if torch.count_nonzero(indices) > 0:

123