| 27 | namespace tensorflow { |
| 28 | |
| 29 | XlaCaseOp::XlaCaseOp(OpKernelConstruction* ctx) : XlaOpKernel(ctx) { |
| 30 | OP_REQUIRES_OK(ctx, ctx->GetAttr("branches", &branches_)); |
| 31 | OP_REQUIRES_OK(ctx, ctx->GetAttr("Tin", &input_types_)); |
| 32 | OP_REQUIRES_OK(ctx, ctx->GetAttr("Tout", &output_types_)); |
| 33 | if (!ctx->GetAttr(kXlaTokenInputNodesAttrName, &token_input_nodes_).ok()) { |
| 34 | has_token_input_output_ = false; |
| 35 | } else { |
| 36 | has_token_input_output_ = !token_input_nodes_.empty(); |
| 37 | } |
| 38 | if (ctx->HasAttr(kPropagateCompileTimeConsts)) { |
| 39 | OP_REQUIRES_OK(ctx, ctx->GetAttr(kPropagateCompileTimeConsts, |
| 40 | &propagate_compile_time_consts_)); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | namespace { |
| 45 | |