Retrieves an XlaExpression that was allocated by a previous Op.
| 51 | |
| 52 | // Retrieves an XlaExpression that was allocated by a previous Op. |
| 53 | static const XlaExpression* CastExpressionFromTensor(const Tensor& tensor) { |
| 54 | const XlaExpression* expression = |
| 55 | reinterpret_cast<const XlaExpression*>(tensor.tensor_data().data()); |
| 56 | CHECK(expression->kind() != XlaExpression::Kind::kInvalid) |
| 57 | << expression->HumanString(); |
| 58 | return expression; |
| 59 | } |
| 60 | |
| 61 | // Assigns an XlaExpression to a tensor on an XLA compilation device. |
| 62 | static void AssignExpressionToTensor(Tensor* tensor, |
no test coverage detected