MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Compile

Method Compile

tensorflow/compiler/tf2xla/kernels/async_io_ops.cc:50–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50void 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
65REGISTER_XLA_OP(Name("_XlaAsyncOutSend"), AsyncOutSendOp);
66

Callers

nothing calls this directly

Calls 9

TensorShapeToXLAShapeFunction · 0.85
AsyncOutSendFunction · 0.85
op_kernel_contextMethod · 0.80
inputMethod · 0.45
shapeMethod · 0.45
dtypeMethod · 0.45
element_typeMethod · 0.45
dimensionsMethod · 0.45
InputMethod · 0.45

Tested by

no test coverage detected