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

Class AssignAddVariableOp

tensorflow/compiler/tf2xla/kernels/variable_ops.cc:91–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89REGISTER_XLA_OP(Name("AssignVariableOp").CompilationOnly(), AssignVariableOp);
90
91class AssignAddVariableOp : public XlaOpKernel {
92 public:
93 explicit AssignAddVariableOp(OpKernelConstruction* ctx) : XlaOpKernel(ctx) {}
94 void Compile(XlaOpKernelContext* ctx) override {
95 DataType type = ctx->input_type(1);
96 xla::XlaOp handle;
97 OP_REQUIRES_OK(ctx,
98 ctx->ReadVariableInput(0, type, /*shape=*/nullptr, &handle));
99 handle = xla::Add(handle, ctx->Input(1));
100 OP_REQUIRES_OK(ctx, ctx->AssignVariable(0, type, handle));
101 }
102};
103REGISTER_XLA_OP(
104 Name("AssignAddVariableOp").TypeConstraint("dtype", kNumericTypes),
105 AssignAddVariableOp);

Callers 3

TESTFunction · 0.50
TEST_FFunction · 0.50
BuildTestGraphFunction · 0.50

Calls

no outgoing calls

Tested by 3

TESTFunction · 0.40
TEST_FFunction · 0.40
BuildTestGraphFunction · 0.40