TODO(phawkins): validate that the dimensions form a valid shape, fail gracefully if they do not.
| 337 | // TODO(phawkins): validate that the dimensions form a valid shape, fail |
| 338 | // gracefully if they do not. |
| 339 | Status XlaOpKernelContext::ConstantInputAsShape(int index, TensorShape* shape) { |
| 340 | xla::Literal literal; |
| 341 | TF_RETURN_IF_ERROR(ConstantInput(index, &literal)); |
| 342 | std::vector<int64> dims; |
| 343 | TF_RETURN_IF_ERROR(LiteralToInt64Vector(literal, &dims)); |
| 344 | *shape = TensorShape(dims); |
| 345 | return Status::OK(); |
| 346 | } |
| 347 | |
| 348 | Status XlaOpKernelContext::ConstantInputAsPartialShape( |
| 349 | int index, PartialTensorShape* shape) { |