Don't try t gather from empty tensors
PiperOrigin-RevId: 312361331 Change-Id: I8f81add090d9a5452e671c48a03e0f5cb9f81a41
This commit is contained in:
parent
53215ab702
commit
af2263101b
@ -154,6 +154,7 @@ class GatherOp : public OpKernel {
|
|||||||
Tensor* out = nullptr;
|
Tensor* out = nullptr;
|
||||||
OP_REQUIRES_OK(c, c->allocate_output(0, result_shape, &out));
|
OP_REQUIRES_OK(c, c->allocate_output(0, result_shape, &out));
|
||||||
if (N == 0) return;
|
if (N == 0) return;
|
||||||
|
if (inner_size == 0) return;
|
||||||
|
|
||||||
int64 bad_i = -1;
|
int64 bad_i = -1;
|
||||||
auto indices_flat = indices.flat<Index>();
|
auto indices_flat = indices.flat<Index>();
|
||||||
|
Loading…
Reference in New Issue
Block a user