File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -58,15 +58,21 @@ class RaggedGatherOpBase : public OpKernel {
5858
5959 void Compute (OpKernelContext* context) override {
6060 // Get the input Tensors.
61+
6162 OpInputList params_nested_splits_in;
6263 OP_REQUIRES_OK (context, context->input_list (" params_nested_splits" ,
6364 ¶ms_nested_splits_in));
65+ OP_REQUIRES (
66+ context, params_nested_splits_in.size () > 0 ,
67+ errors::InvalidArgument (" params_nested_splits must be non empty" ));
68+
6469 const Tensor& params_dense_values_in =
6570 context->input (params_nested_splits_in.size ());
6671 const Tensor& indices_in =
6772 context->input (params_nested_splits_in.size () + 1 );
6873
69- DCHECK_GT (params_nested_splits_in.size (), 0 ); // Enforced by REGISTER_OP.
74+ OP_REQUIRES (context, params_nested_splits_in[0 ].dims () > 0 ,
75+ errors::InvalidArgument (" Split tensors must not be scalars" ));
7076 SPLITS_TYPE num_params = params_nested_splits_in[0 ].dim_size (0 ) - 1 ;
7177 OP_REQUIRES_OK (context, ValidateIndices (indices_in, num_params));
7278
You can’t perform that action at this time.
0 commit comments