| 30 | namespace { |
| 31 | |
| 32 | Status ReadVariableShapeFn(InferenceContext* c) { |
| 33 | std::vector<ShapeAndType> shape_and_type; |
| 34 | TF_RETURN_IF_ERROR( |
| 35 | shape_inference::ValidateVariableResourceHandle(c, &shape_and_type)); |
| 36 | c->set_output(0, shape_and_type[0].shape); |
| 37 | if (shape_and_type[0].dtype == DT_VARIANT && shape_and_type.size() > 1) { |
| 38 | std::vector<ShapeAndType> variant_shape_and_type; |
| 39 | std::copy(shape_and_type.begin() + 1, shape_and_type.end(), |
| 40 | std::back_inserter(variant_shape_and_type)); |
| 41 | c->set_output_handle_shapes_and_types(0, variant_shape_and_type); |
| 42 | } |
| 43 | return Status::OK(); |
| 44 | } |
| 45 | |
| 46 | Status ReadVariablesShapeFn(InferenceContext* c) { |
| 47 | int n; |
nothing calls this directly
no test coverage detected