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

Class ReadVariableOp

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

Source from the content-addressed store, hash-verified

61REGISTER_XLA_OP(Name("VariableShape").IsMetadataOp(), VariableShapeOp);
62
63class ReadVariableOp : public XlaOpKernel {
64 public:
65 explicit ReadVariableOp(OpKernelConstruction* ctx) : XlaOpKernel(ctx) {
66 OP_REQUIRES_OK(ctx, ctx->GetAttr("dtype", &dtype_));
67 }
68
69 void Compile(XlaOpKernelContext* ctx) override {
70 xla::XlaOp handle;
71 OP_REQUIRES_OK(
72 ctx, ctx->ReadVariableInput(0, dtype_, /*shape=*/nullptr, &handle));
73 ctx->SetOutput(0, handle);
74 }
75
76 private:
77 DataType dtype_;
78};
79REGISTER_XLA_OP(Name("ReadVariableOp").CompilationOnly(), ReadVariableOp);
80
81class AssignVariableOp : public XlaOpKernel {

Callers 6

TEST_FFunction · 0.50
BuildTestGraphFunction · 0.50
MakeReadFunction · 0.50
MakeBodyGraphFunction · 0.50
TESTFunction · 0.50
MakeReadFunction · 0.50

Calls

no outgoing calls

Tested by 6

TEST_FFunction · 0.40
BuildTestGraphFunction · 0.40
MakeReadFunction · 0.40
MakeBodyGraphFunction · 0.40
TESTFunction · 0.40
MakeReadFunction · 0.40