| 164 | } |
| 165 | |
| 166 | Status GetElementShapeFromInput(OpKernelContext* c, |
| 167 | const TensorList& tensor_list, int index, |
| 168 | PartialTensorShape* element_shape) { |
| 169 | TF_RETURN_IF_ERROR(TensorShapeFromTensor(c->input(index), element_shape)); |
| 170 | // Check that `element_shape` and `tensor_list.element_shape` are |
| 171 | // compatible and store the merged shape in `element_shape`. |
| 172 | PartialTensorShape tmp = *element_shape; |
| 173 | TF_RETURN_IF_ERROR(tmp.MergeWith(tensor_list.element_shape, element_shape)); |
| 174 | return Status::OK(); |
| 175 | } |
| 176 | |
| 177 | Status GetInputList(OpKernelContext* c, int index, const TensorList** list) { |
| 178 | if (!TensorShapeUtils::IsScalar(c->input(index).shape())) { |