| 指标 | 值 |
|---|---|
| 设备 | Ascend 910B4 |
| 精度 | float32 |
| Cosine Similarity | 0.999999 |
| Max Absolute Error | 0.009554 |
| NPU 推理时间 | 4.82ms |
python3 inference.py
=== tinynet_d.in1k ===
Dtype: torch.float32
--- CPU 推理 ---
输出形状: torch.Size([1, 1000])
输出前5值: [-0.23708903789520264, -0.16539707779884338, -1.516122817993164, -0.13567812740802765, 0.9884318113327026]
推理时间: 92.63ms
--- NPU 推理 ---
输出形状: torch.Size([1, 1000])
输出前5值: [-0.23514406383037567, -0.16472090780735016, -1.5170665979385376, -0.13631096482276917, 0.988941490650177]
推理时间: 4.82ms
=== 精度对比 ===
Cosine Similarity: 0.999999
Max Absolute Error: 0.009554
Relative Error: 0.005753
✓ NPU 适配通过CPU 与 NPU 推理结果对比:
# 安装依赖
pip install torch torch_npu timm huggingface_hub safetensors
# 运行推理
python3 inference.py本适配由 vision-encoder-npu-adapt Agent Skill 自动完成,包含: