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

Method InferStatically

tensorflow/core/grappler/costs/graph_memory.cc:34–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32namespace grappler {
33
34Status GraphMemory::InferStatically(
35 const std::unordered_map<string, DeviceProperties>& devices) {
36 VirtualCluster cluster(devices);
37 TF_RETURN_IF_ERROR(cluster.Provision());
38 TF_RETURN_IF_ERROR(cluster.Initialize(item_));
39 RunMetadata metadata;
40 Status s = cluster.Run(item_, &metadata);
41 // The virtual cluster returns the RESOURCE_EXHAUSTED error when it detects
42 // that the model would run out of memory. We still get the metadata we need
43 // out of the simulation, so we just ignore this error.
44 if (!s.ok() && s.code() != error::RESOURCE_EXHAUSTED) {
45 return s;
46 }
47 InferFromTrace(metadata.step_stats());
48 return Status::OK();
49}
50
51Status GraphMemory::InferDynamically(Cluster* cluster) {
52 if (!cluster->DetailedStatsEnabled()) {

Callers 15

GenerateReportMethod · 0.45
TEST_FFunction · 0.45
TESTFunction · 0.45
RunValidationMethod · 0.45
OptimizeMethod · 0.45
RunConvertAfterShapeMethod · 0.45
OptimizeMethod · 0.45
RunOptimizationPassMethod · 0.45
OptimizeMethod · 0.45
OptimizeMethod · 0.45

Calls 5

ProvisionMethod · 0.45
InitializeMethod · 0.45
RunMethod · 0.45
okMethod · 0.45
codeMethod · 0.45

Tested by 8

TEST_FFunction · 0.36
TESTFunction · 0.36
RunValidationMethod · 0.36
RunConvertAfterShapeMethod · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36