EADST

Convert Paddle Tensor to Numpy to List

Convert Paddle Tensor to Numpy to List

import cv2
import numpy
import paddle

# load an image
im = cv2.imread("test.jpg")
print(type(im)) # 

# numpy to tensor
tensor_data = paddle.to_tensor(data) 
print(type(tensor_data)) # 

# tensor to numpy
numpy_data = tensor_data.numpy() 
print(type(numpy_data)) # 

# numpy to list
list_data = numpy_data.tolist()
print(type(list_data)) # 

# tensor to list
tlist_data = tensor_data.tolist()
print(type(tlist_data)) # 

# list to tensor
ltensor_data = paddle.to_tensor(tlist_data) 
print(type(ltensor_data)) # 

# list to numpy
lnumpy_data = np.array(list_data)
print(type(lnumpy_data)) # 
相关标签
About Me
XD
Goals determine what you are going to be.
Category
标签云
Docker Template UI ONNX torchinfo Sklearn HaggingFace Shortcut Cloudreve Quantization TSV 公式 Quantize uwsgi mmap Proxy FlashAttention VSCode Hungarian FP32 Domain SQL 继承 Ubuntu icon Video Tensor tqdm Numpy Jupyter NLTK NameSilo Password Transformers 论文速读 PDF 版权 Vmess 多线程 PyTorch InvalidArgumentError Django DeepStream 强化学习 图标 Excel Qwen2.5 git-lfs Image2Text 证件照 LLAMA Vim ms-swift Tracking ResNet-50 RL hf Card Safetensors Gemma git Conda v2ray Disk Jetson Michelin FP64 AI Translation CC OpenAI PyCharm 音频 MD5 多进程 Website 净利润 Plotly Github LaTeX DeepSeek Python Windows FP8 Logo JSON Base64 Qwen Clash 域名 API Paddle PIP Input Web Harness Tiktoken SQLite RGB 搞笑 WAN UNIX NLP Rebuttal Data Permission Random BTC Use Zip FP16 顶会 Streamlit logger TTS Pandas Distillation COCO GPTQ Ptyhon CTC Jev Breakpoint Magnet Math Crawler GIT YOLO Git Bitcoin BeautifulSoup CEIR Paper CUDA ModelScope Pickle News Plate OCR Markdown Augmentation CV Nginx 图形思考法 Miniforge Baidu Review PDB Hilton 算法题 Agent printf diffusers Anaconda Statistics VGG-16 OpenCV transformers TensorFlow 阿里云 Search Linux 签证 Claude scipy Pytorch API网关 Food 腾讯云 Qwen2 关于博主 FastAPI SVR v0.dev GGML Hotel IndexTTS2 Knowledge Land Attention WebCrawler Bipartite Firewall LLM Dataset Animate Diagram XML 云服务器 递归学习法 llama.cpp BF16 Bert SAM Bin RAR 报税 Llama Color Freesound tar Heatmap GPT4 XGBoost EXCEL Mixtral uWSGI 飞书 财报 SPIE Datetime VPN Google CSV LeetCode Interview LoRA CLAP HuggingFace 第一性原理 QWEN GoogLeNet Algorithm C++ 论文 ChatGPT Pillow TensorRT CAM
站点统计

本站现有博文337篇,共被浏览961403次

本站已经建立2673天!

热门文章
文章归档
回到顶部