---
title: 开发验证
description: "执行以下命令进行验证。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengai/ecosystemEnable/pytorch/kunpengpytorch_16_0006.html
sourcePath: /source/zh/kunpengai/ecosystemEnable/pytorch/kunpengpytorch_16_0006.html
indexId: 47f02d083bf0a5f2e14f6370c899736269ec2f20c639480b8b70aeb40a1e843a72
---
# 开发验证

执行以下命令进行验证。

```
python3 - <<'PY'
import torch

print("torch_version=" + torch.__version__) 
print("cuda_built=" + str(torch.backends.cuda.is_built())) 
print("torch_cuda_version=" + str(torch.version.cuda)) 
print("cuda_available=" + str(torch.cuda.is_available())) 
assert torch.backends.cuda.is_built() 
assert str(torch.version.cuda).startswith("13.0") 
assert torch.cuda.is_available()  

x = torch.tensor([[1.0, 2.0], [3.0, 4.0]]) 
y = torch.tensor([[5.0, 6.0], [7.0, 8.0]]) 
print("gpu_matmul=" + str((x.cuda() @ y.cuda()).cpu().tolist())) 
PY
```

预期输出如下信息：

```
torch_version=2.11.0 
cuda_built=True 
torch_cuda_version=13.0 
cuda_available=True 
gpu_matmul=[[19.0, 22.0], [43.0, 50.0]]
```
