Merge pull request #25702 from yongtang:25701-dim_size-int
PiperOrigin-RevId: 236189226
This commit is contained in:
commit
f929a5dbd9
@ -78,9 +78,6 @@ class SparseDenseBinaryOpShared : public OpKernel {
|
||||
"but received shapes: ",
|
||||
values_t->shape().DebugString(), " and ",
|
||||
shape_t->shape().DebugString()));
|
||||
OP_REQUIRES(ctx, indices_t->dim_size(0) < std::numeric_limits<int>::max(),
|
||||
errors::InvalidArgument(
|
||||
"Number of non-zero elements exceeds int32 range"));
|
||||
|
||||
const auto indices_mat = indices_t->matrix<int64>();
|
||||
const auto shape_vec = shape_t->vec<int64>();
|
||||
@ -106,7 +103,7 @@ class SparseDenseBinaryOpShared : public OpKernel {
|
||||
|
||||
Tensor *output_values = nullptr;
|
||||
Tensor dense_gathered;
|
||||
const int nnz = static_cast<int>(indices_t->dim_size(0));
|
||||
const int64 nnz = indices_t->dim_size(0);
|
||||
OP_REQUIRES_OK(ctx,
|
||||
ctx->allocate_output(0, TensorShape({nnz}), &output_values));
|
||||
OP_REQUIRES_OK(
|
||||
|
Loading…
Reference in New Issue
Block a user