Convert a TensorShape into the equivalent XLA Shape proto.
| 100 | |
| 101 | // Convert a TensorShape into the equivalent XLA Shape proto. |
| 102 | Status TensorShapeToXLAShape(DataType dtype, const TensorShape& tensor_shape, |
| 103 | xla::Shape* shape) { |
| 104 | xla::PrimitiveType type; |
| 105 | TF_RETURN_IF_ERROR(DataTypeToPrimitiveType(dtype, &type)); |
| 106 | *shape = TensorShapeToXLAShape(type, tensor_shape); |
| 107 | return Status::OK(); |
| 108 | } |
| 109 | |
| 110 | xla::Shape TensorShapeToXLAShape(xla::PrimitiveType type, |
| 111 | const TensorShape& tensor_shape) { |