def callback(self, value, latency=None):
    if self._collect_aggregated_statistics:
        if (not self._aggregated_statistics):
            self._aggregated_statistics = AggregatedStatistics(iterations_count=self._iterations_count, dataset_size=self._dataset_size)
        self._aggregated_statistics.add(self._network, self._exec_network, value)
    if self._collect_results:
        if self._collect_layers:
            collect_value = dict()
            for layer_name in value:
                if (layer_name in self._collect_layers):
                    collect_value[layer_name] = value[layer_name]
            self._infer_raw_results.add(collect_value)
        else:
            self._infer_raw_results.add(value)
    if latency:
        self._latencies.append(latency)
def callback(self, value, latency=None):
    if self._collect_aggregated_statistics:
        if (not self._aggregated_statistics):
            self._aggregated_statistics = AggregatedStatistics(iterations_count=self._iterations_count, dataset_size=self._dataset_size)
        self._aggregated_statistics.add(self._network, self._exec_network, value)
    if self._collect_results:
        if self._collect_layers:
            collect_value = dict()
            for layer_name in value:
                if (layer_name in self._collect_layers):
                    collect_value[layer_name] = value[layer_name]
            self._infer_raw_results.add(collect_value)
        else:
            self._infer_raw_results.add(value)
    if latency:
        self._latencies.append(latency)