class_docstr: Wrap original node for calculating statistic metrics.
class_docstr_tok: ["Wrap","original","node","for","calculating","statistic","metrics","."]
code: def cal_statistic(self):
      for child in self.children_node:
          child.cal_statistic()
          if child.is_terminal_operator_node is False:
              self.is_terminal_operator_node = False
      for rt in self.runtime_node:
          rt.cal_statistic()
      self.cpu_time = self.hostnode.end_ns - self.hostnode.start_ns
      self.self_cpu_time = self.cpu_time
      for child in self.children_node:
          if child.type == "Operator":
              self.is_terminal_operator_node = False
          self.gpu_time += child.gpu_time
          self.general_gpu_time += child.general_gpu_time
          self.self_cpu_time -= child.end_ns - child.start_ns
      for rt in self.runtime_node:
          self.self_cpu_time -= rt.end_ns - rt.start_ns
          self.gpu_time += rt.gpu_time
          self.self_gpu_time += rt.gpu_time
          self.general_gpu_time += rt.general_gpu_time
          self.self_general_gpu_time += rt.general_gpu_time
      for device in self.hostnode.device_node:
          if device.type == "Kernel":
              self.gpu_time += device.end_ns - device.start_ns
              self.self_gpu_time += device.end_ns - device.start_ns
          self.general_gpu_time += device.end_ns - device.start_ns
          self.self_general_gpu_time += device.end_ns - device.start_ns
  
imports: import collections
  import os
  import sys
label_desc: Use image node_id 2 for calling the HostStatisticNode obj's underlying member method code with example usage: obj.cal_statistic() without return types