Skip to content

Commit ebbe26f

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Fix numel() downcast in dper_lib/silvertorch/core/legacy/tools/eval/tests/TestUtil.cpp +2
Summary: `numel()` has type `int64_t`. The implicit downcasts fix in this change artificially truncate data ranges which can lead to hard-to-debug errors and SEVs. Using `auto` ensures that the correct data type is used. Reviewed By: dtolnay Differential Revision: D73533979
1 parent 954f2cb commit ebbe26f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backends/cadence/fusion_g3/operators/op_mean.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Tensor& mean_out(
106106
const float* __restrict__ p_inp =
107107
(const float* __restrict__)in.const_data_ptr<float>();
108108

109-
int num_elm = in.numel();
109+
auto num_elm = in.numel();
110110

111111
int num_inp_dims = in.dim();
112112
int num_out_dims = out.dim();

0 commit comments

Comments
 (0)