-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix conversion of TensorData, TensorsData to json #22166
Conversation
Thanks for making TensorsData and TensorData serializable.
However, it currently serializes much more tensor data's information:
Could you help add additional functionality to simply extract the tensor name and an absolute value that required by TRT EP? |
I just made a change to restore the previous format. Let me know if that's ok with you. |
Thanks! 700 zero = np.array(0)
701 for key in sorted(calibration_cache.keys()):
702 values = calibration_cache[key]
703 d_values = values.to_dict()
704 floats = [
705 float(d_values.get("highest", zero).item()),
706 float(d_values.get("lowest", zero).item()),
707 ]
708 value = str(max(floats)) # str(max(abs(values[0]), abs(values[1])))
709
710 flat_key = builder.CreateString(key)
711 flat_value = builder.CreateString(value) |
I don't know block very well. Do you know the file I should modify? |
|
Sorry, I did not see, it was just above. I just pushed the changes. |
### Description Fix write_calibration_table to support TensorData, TensorsData
Description
Fix write_calibration_table to support TensorData, TensorsData