| 23 | using shape_inference::ShapeHandle; |
| 24 | |
| 25 | static Status StatelessShape(InferenceContext* c) { |
| 26 | // Check seed shape |
| 27 | ShapeHandle seed; |
| 28 | TF_RETURN_IF_ERROR(c->WithRank(c->input(1), 1, &seed)); |
| 29 | DimensionHandle unused; |
| 30 | TF_RETURN_IF_ERROR(c->WithValue(c->Dim(seed, 0), 2, &unused)); |
| 31 | |
| 32 | // Set output shape |
| 33 | ShapeHandle out; |
| 34 | TF_RETURN_IF_ERROR(c->MakeShapeFromShapeTensor(0, &out)); |
| 35 | c->set_output(0, out); |
| 36 | return Status::OK(); |
| 37 | } |
| 38 | |
| 39 | #define REGISTER_STATELESS_OP(name) \ |
| 40 | REGISTER_OP(name) \ |
no test coverage detected