| 275 | } // anonymous namespace |
| 276 | |
| 277 | XlaWhileOp::XlaWhileOp(OpKernelConstruction* ctx) : XlaOpKernel(ctx) { |
| 278 | const NameAttrList* name_attr; |
| 279 | OP_REQUIRES_OK(ctx, ctx->GetAttr("cond", &name_attr)); |
| 280 | cond_name_attr_ = *name_attr; |
| 281 | OP_REQUIRES_OK(ctx, ctx->GetAttr("body", &name_attr)); |
| 282 | body_name_attr_ = *name_attr; |
| 283 | if (!ctx->GetAttr(kXlaTokenInputNodesAttrName, &token_input_nodes_).ok()) { |
| 284 | has_token_input_output_ = false; |
| 285 | } else { |
| 286 | has_token_input_output_ = !token_input_nodes_.empty(); |
| 287 | } |
| 288 | if (ctx->HasAttr(kPropagateCompileTimeConsts)) { |
| 289 | OP_REQUIRES_OK(ctx, ctx->GetAttr(kPropagateCompileTimeConsts, |
| 290 | &propagate_compile_time_consts_)); |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | void XlaWhileOp::Compile(XlaOpKernelContext* ctx) { |
| 295 | VLOG(1) << "WhileOp::Compile"; |