| 23 | using shape_inference::ShapeHandle; |
| 24 | |
| 25 | static ShapeHandle ShapeOrHandleShape(InferenceContext* c, int input) { |
| 26 | auto* handle_data = c->input_handle_shapes_and_types(input); |
| 27 | if (handle_data != nullptr && !handle_data->empty() && |
| 28 | (*handle_data)[0].dtype != DT_INVALID) { |
| 29 | return (*handle_data)[0].shape; |
| 30 | } |
| 31 | return c->input(input); |
| 32 | } |
| 33 | |
| 34 | // Handle the gradient and, if <sparse>, indices inputs. |
| 35 | // <s> is an input+output parameter, containing the current known input shape to |
no test coverage detected