/minip.jpg

技术博客分享

typora数学符号

/weixin_miniapp.png

typora数学符号

typora数学符号

Typora 是一个支持 LaTeX 数学公式的优秀 Markdown 编辑器,可以直接编写数学公式并实时渲染。以下是如何在 Typora 中使用数学公式的详细指南:


1. 启用数学公式支持

默认情况下,Typora 支持 LaTeX 格式的数学公式,无需额外设置。如果未生效,请确保已启用数学渲染:

2024-12-23-pytorch测试GPU是否可用

/weixin_miniapp.png

pytorch:测试GPU是否可用

import torch
flag = torch.cuda.is_available()
print(flag)

ngpu= 1
# Decide which device we want to run on
device = torch.device("cuda:0" if (torch.cuda.is_available() and ngpu > 0) else "cpu")
print(device)
print(torch.cuda.get_device_name(0))
print(torch.rand(3,3).cuda()) 
True
cuda:0
GeForce GTX 1080
tensor([[0.9530, 0.4746, 0.9819],
        [0.7192, 0.9427, 0.6768],
        [0.8594, 0.9490, 0.6551]], device='cuda:0')

68747470733a2f2f626c6f67:2e6373646e2e6e65742f77656978696e5f3335353736383831:2f61727469636c652f64657461696c732f3839373039313136