mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
fix json format (#11046)
Co-authored-by: Randy Shuai <rashuai@microsoft.com>
This commit is contained in:
parent
9616ad483f
commit
9505e8c6c1
2 changed files with 10 additions and 5 deletions
|
|
@ -59,6 +59,7 @@ static void CalculateTotalOutputSizes(OpKernelContextInternal* op_kernel_context
|
|||
size_t& total_output_sizes, const std::string& node_name, std::string& output_type_shape) {
|
||||
// Calculate total output sizes for this operation.
|
||||
std::stringstream ss;
|
||||
int added_type_shapes = 0;
|
||||
ss << "[";
|
||||
total_output_sizes = 0;
|
||||
ORT_UNUSED_PARAMETER(node_name);
|
||||
|
|
@ -78,8 +79,9 @@ static void CalculateTotalOutputSizes(OpKernelContextInternal* op_kernel_context
|
|||
#endif
|
||||
total_output_sizes += tensor_size;
|
||||
auto shape_str = tensor.Shape().ToString();
|
||||
ss << "{\"" << DataTypeImpl::ToString(tensor.DataType()) << "\":["
|
||||
<< shape_str.substr(1, shape_str.size() - 2) << "]" << (i == output_count - 1 ? "}" : "},");
|
||||
ss << (added_type_shapes++ > 0 ? "," : "")
|
||||
<< "{\"" << DataTypeImpl::ToString(tensor.DataType()) << "\":["
|
||||
<< shape_str.substr(1, shape_str.size() - 2) << "]}";
|
||||
}
|
||||
}
|
||||
ss << "]";
|
||||
|
|
@ -93,6 +95,7 @@ static void CalculateTotalInputSizes(const OpKernelContextInternal* op_kernel_co
|
|||
// Calculate total input sizes for this operation.
|
||||
std::stringstream ss;
|
||||
ss << "[";
|
||||
int added_type_shapes = 0;
|
||||
input_activation_sizes = 0;
|
||||
input_parameter_sizes = 0;
|
||||
ORT_UNUSED_PARAMETER(node_name);
|
||||
|
|
@ -124,8 +127,9 @@ static void CalculateTotalInputSizes(const OpKernelContextInternal* op_kernel_co
|
|||
input_activation_sizes += tensor_size;
|
||||
}
|
||||
auto shape_str = p_tensor->Shape().ToString();
|
||||
ss << "{\"" << DataTypeImpl::ToString(p_tensor->DataType()) << "\":["
|
||||
<< shape_str.substr(1, shape_str.size() - 2) << "]" << (i == input_count - 1 ? "}" : "},");
|
||||
ss << (added_type_shapes++ > 0 ? "," : "")
|
||||
<< "{\"" << DataTypeImpl::ToString(p_tensor->DataType()) << "\":["
|
||||
<< shape_str.substr(1, shape_str.size() - 2) << "]}";
|
||||
}
|
||||
}
|
||||
ss << "]";
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>My First JavaScript Treemap Chart</title>
|
||||
<title id="filename">Onnxruntime Perf View</title>
|
||||
<script type="text/javascript" src="https://cdn.anychart.com/releases/v8/js/anychart-core.min.js"></script>
|
||||
<script src="https://cdn.anychart.com/releases/8.11.0/js/anychart-ui.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.anychart.com/releases/v8/js/anychart-treemap.min.js"></script>
|
||||
|
|
@ -60,6 +60,7 @@
|
|||
preloader.visible(true);
|
||||
|
||||
const fileList = event.target.files;
|
||||
document.getElementById('filename').text = fileList[0].name;
|
||||
console.log(fileList);
|
||||
const reader = new FileReader();
|
||||
reader.addEventListener('load', (event) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue