| 48 | } |
| 49 | |
| 50 | void AsyncOutSendOp::Compile(XlaOpKernelContext* ctx) { |
| 51 | // Always restore to the TensorShape. |
| 52 | const Tensor& input = ctx->op_kernel_context()->input(0); |
| 53 | const TensorShape& shape = input.shape(); |
| 54 | const DataType dtype = input.dtype(); |
| 55 | xla::Shape xla_shape; |
| 56 | OP_REQUIRES_OK(ctx, TensorShapeToXLAShape(dtype, shape, &xla_shape)); |
| 57 | // Tensorflow always expects a row-major layout. So, always provide a shape |
| 58 | // with row-major layout to AsyncOutSend. The XLA layout_assignment pass will |
| 59 | // be constrained accordingly. |
| 60 | xla::Shape shape_with_layout = xla::ShapeUtil::MakeShapeWithDescendingLayout( |
| 61 | xla_shape.element_type(), xla_shape.dimensions()); |
| 62 | xla::AsyncOutSend(ctx->Input(0), shape_with_layout, key_); |
| 63 | } |
| 64 | |
| 65 | REGISTER_XLA_OP(Name("_XlaAsyncOutSend"), AsyncOutSendOp); |
| 66 |
nothing calls this directly
no test coverage detected