@@ -23,12 +23,15 @@ bool check_gather_args(
2323 ET_LOG_AND_RETURN_IF_FALSE (tensor_has_dim (in, dim));
2424 ET_CHECK_OR_RETURN_FALSE (
2525 index.scalar_type () == ScalarType::Long,
26- " Expected dypte int64 for index" );
26+ " Expected dypte int64 for index; index.scalar_type() = %d" ,
27+ static_cast <int >(index.scalar_type ()));
2728 if (index.numel () != 0 ) {
2829 ET_CHECK_OR_RETURN_FALSE (
2930 nonzero_dim (in) == nonzero_dim (index),
3031 " self and index should have the same dimensionality when index is not empty "
31- " except for the case when one has dimension 0 and the other has dimension 1" );
32+ " except for the case when one has dimension 0 and the other has dimension 1; nonzero_dim(in) = %zd, nonzero_dim(index) = %zd" ,
33+ nonzero_dim (in),
34+ nonzero_dim (index));
3235 }
3336
3437 // Normalize dim to non-negative value
@@ -67,7 +70,8 @@ bool check_index_select_args(
6770 dim = dim < 0 ? dim + nonzero_dim (in) : dim;
6871 ET_CHECK_OR_RETURN_FALSE (
6972 nonempty_size (in, dim) > 0 ,
70- " index_select: Indexing axis dim should be positive" );
73+ " index_select: Indexing axis dim should be positive; nonempty_size(in, dim) = %zd" ,
74+ nonempty_size (in, dim));
7175
7276 ET_LOG_AND_RETURN_IF_FALSE (tensors_have_same_dtype (in, out));
7377 ET_CHECK_OR_RETURN_FALSE (
@@ -80,7 +84,8 @@ bool check_index_select_args(
8084 if (index.dim () > 0 && in.dim () == 0 ) {
8185 ET_CHECK_OR_RETURN_FALSE (
8286 index.numel () == 1 ,
83- " index_select: Index to scalar must have exactly 1 value" );
87+ " index_select: Index to scalar must have exactly 1 value; index.numel() = %zd" ,
88+ index.numel ());
8489 }
8590
8691 if (index.scalar_type () == ScalarType::Long) {
@@ -150,7 +155,8 @@ bool check_scatter_add_args(
150155 ET_LOG_AND_RETURN_IF_FALSE (tensors_have_same_dtype (self, src));
151156 ET_CHECK_OR_RETURN_FALSE (
152157 index.scalar_type () == ScalarType::Long,
153- " Expected dypte int64 for index" );
158+ " Expected dypte int64 for index; index.scalar_type() = %d" ,
159+ static_cast <int >(index.scalar_type ()));
154160 ET_LOG_AND_RETURN_IF_FALSE (tensor_has_dim (self, dim));
155161
156162 if (index.numel () == 0 ) {
@@ -160,7 +166,10 @@ bool check_scatter_add_args(
160166 ET_CHECK_OR_RETURN_FALSE (
161167 nonzero_dim (self) == nonzero_dim (src) &&
162168 nonzero_dim (self) == nonzero_dim (index),
163- " self, index and src should have same number of dimensions." );
169+ " self, index and src should have same number of dimensions; nonzero_dim(self) = %zd, nonzero_dim(src) = %zd, nonzero_dim(index) = %zd" ,
170+ nonzero_dim (self),
171+ nonzero_dim (src),
172+ nonzero_dim (index));
164173
165174 // Normalize dim to non-negative value
166175 if (dim < 0 ) {
0 commit comments