当前位置: 代码迷 >> 综合 >> tensor 序列化成bytes再转成hex字符串(16进制)互转
  详细解决方案

tensor 序列化成bytes再转成hex字符串(16进制)互转

热度:85   发布时间:2023-11-21 19:17:41.0
def hex_to_fea(fea_hex):fea_bytes = bytes.fromhex(fea_hex)feature=pickle.loads(fea_bytes)return featuredef feature_pickle_base(feature):fea_pik=pickle.dumps(feature)fea_hex =fea_pik.hex() # tensor 序列化成bytes再转成hex字符串(16进制)return fea_hex
  相关解决方案