internal MemorySnapshotReport(IOps ops, IVarsStatistics vars, string context, Layer layer) { ContextType = context; ContextName = ""; if (layer != null) { ContextType += ": " + layer.type + ((layer.type == Layer.Type.Activation) ? ("." + layer.activation) : ""); ContextName += layer.name; } TensorsMemoryInfo = new List <TensorMemoryInfo>(); AllocatorsMemoryInfo = new List <AllocatorMemoryInfo>(); TempMemoriesInfo = new List <TempMemoryInfo>(); foreach (var allocatorsStatistic in vars.GetAllocatorsStatistics()) { AllocatorsMemoryInfo.Add(new AllocatorMemoryInfo(allocatorsStatistic)); } foreach (var tensorStatistic in vars.GetTensorsStatistics()) { TensorsMemoryInfo.Add(new TensorMemoryInfo(tensorStatistic)); } foreach (var tempMemoryStatistic in ops.GetTempMemoryStatistics()) { TempMemoriesInfo.Add(new TempMemoryInfo(tempMemoryStatistic)); } }
/// <inheritdoc/> public IEnumerable<TempMemoryStatistics> GetTempMemoryStatistics() { return m_Ops.GetTempMemoryStatistics(); }