| 54 | } |
| 55 | |
| 56 | static void DoValidationChecking(OpKernelContext* c, const Tensor& params, |
| 57 | const Tensor& indices, const Tensor& updates) { |
| 58 | OP_REQUIRES(c, params.IsInitialized(), |
| 59 | errors::FailedPrecondition("Null ref for params")); |
| 60 | OP_REQUIRES(c, TensorShapeUtils::IsVectorOrHigher(params.shape()), |
| 61 | errors::InvalidArgument("params must be at least 1-D, got shape ", |
| 62 | params.shape().DebugString())); |
| 63 | OP_REQUIRES( |
| 64 | c, ValidShapes(params, updates, indices), |
| 65 | errors::InvalidArgument("Must have updates.shape = indices.shape + " |
| 66 | "params.shape[1:] or updates.shape = [], got ", |
| 67 | "updates.shape ", updates.shape().DebugString(), |
| 68 | ", indices.shape ", indices.shape().DebugString(), |
| 69 | ", params.shape ", params.shape().DebugString())); |
| 70 | } |
| 71 | |
| 72 | template <typename Device, typename T, typename Index, scatter_op::UpdateOp op> |
| 73 | class ScatterUpdateOp : public OpKernel { |
no test coverage detected