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

Class XlaComputation

tensorflow/compiler/xla/client/xla_computation.h:29–64  ·  view source on GitHub ↗

The computation graph that the user builds up with the XlaBuilder.

Source from the content-addressed store, hash-verified

27
28// The computation graph that the user builds up with the XlaBuilder.
29class XlaComputation {
30 public:
31 XlaComputation() : unique_id_(-1) {}
32 XlaComputation(const HloModuleProto& proto)
33 : unique_id_(proto.id()), proto_(proto) {}
34
35 ~XlaComputation() {}
36
37 XlaComputation(const XlaComputation&) = delete;
38 XlaComputation& operator=(const XlaComputation&) = delete;
39
40 XlaComputation(XlaComputation&& from) = default;
41
42 XlaComputation& operator=(XlaComputation&& from) = default;
43
44 // Returns the "program shape" (parameter and return shapes) for this
45 // computation.
46 StatusOr<ProgramShape> GetProgramShape() const;
47
48 const HloModuleProto& proto() const { return proto_; }
49
50 // Requests that we snapshot the computation into a serializable protocol
51 // buffer form.
52 StatusOr<std::unique_ptr<HloSnapshot>> Snapshot() const;
53
54 // Returns true if this object is a null Computation.
55 bool IsNull() const { return unique_id_ == -1; }
56
57 private:
58 XlaComputation(const int64 unique_id) : unique_id_(unique_id) {}
59 HloModuleProto* mutable_proto() { return &proto_; }
60 friend class XlaBuilder;
61
62 int64 unique_id_;
63 HloModuleProto proto_;
64};
65
66} // namespace xla
67

Callers 3

BuildWrappedBodyFunction · 0.85
LoadSnapshotMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected