return call;
}
+int64 HloModule::instruction_count() const {
+ int64 n = 0;
+ for (const auto& computation : computations_) {
+ n += computation->instruction_count();
+ }
+ return n;
+}
+
std::list<HloComputation*> HloModule::MakeComputationPostOrder() const {
// First determine all root computations by building a set of nonroot
// computations (computations which are called by an instruction in the
// Gets the number of computations in this module.
int64 computation_count() const { return computations_.size(); }
+ // Gets the number of instructions in this module.
+ int64 instruction_count() const;
+
// Compute and return a post order of all computations in the module. The sort
// is defined like so: if computation A has an instruction which calls
// computation B, then A will appear after B in the sort.