Returns true if the three tensors have valid number of elements If shape_input has 0 elements, then we need to have indices and updates with exactly 0 elements too, otherwise we should error. If indices has 0 elements then updates should also have 0 elements, otherwise we should error.
| 54 | // exactly 0 elements too, otherwise we should error. If indices has 0 elements |
| 55 | // then updates should also have 0 elements, otherwise we should error. |
| 56 | bool ValidEmptyOutputShape(int64 num_inputs, int64 num_indices, |
| 57 | int64 num_updates) { |
| 58 | if (num_indices == 0 && num_updates == 0) { |
| 59 | return true; // regardless of num_inputs ?= 0, covers both cases |
| 60 | } |
| 61 | // now we want all 3 tensors to have values |
| 62 | return (num_inputs != 0 && num_indices != 0 && num_updates != 0); |
| 63 | } |
| 64 | |
| 65 | template <typename Device, typename T, typename Index> |
| 66 | class ScatterNdOp : public OpKernel { |
no outgoing calls
no test coverage detected