return Status::OK();
}
+Status ExplicitShapes(InferenceContext* c) {
+ std::vector<PartialTensorShape> shapes;
+ TF_RETURN_IF_ERROR(c->GetAttr("shapes", &shapes));
+ if (shapes.empty()) {
+ return errors::Internal("shapes attribute is empty");
+ }
+ for (int i = 0; i < shapes.size(); ++i) {
+ ShapeHandle output_shape;
+ TF_RETURN_IF_ERROR(
+ c->MakeShapeFromPartialTensorShape(shapes[i], &output_shape));
+ c->set_output(i, output_shape);
+ }
+ return Status::OK();
+}
+
} // namespace shape_inference
} // namespace tensorflow
// Shape function for ops with an explicit "shape" attribute.
Status ExplicitShape(InferenceContext* c);
+// Shape function for multiple-output ops with an explicit "shapes" attribute.
+Status ExplicitShapes(InferenceContext* c);
+
} // namespace shape_inference
} // namespace tensorflow