PyTorch-->pytorch学习(2)

IPython

1.torch.abs? # 查看abs函数文档

2.torch.abs?? # 查看abs函数源码

3.%timeit a.sum() # 检测a.sum()执行时间

4.%hist # 查看输入历史

5.%paste # 执行粘贴板中的代码

6.%cat a.py # 查看a.py文件中的内容

7.%run -i a.py # 执行a.py, -i:在当前命名空间执行,使用当前命名空间中的变量,结果返回至当前命名空间

 

 jupyter

pip install jupyter # 安装

jupyter notebook # 启动

# 使用密码登录

ipython

from notebook.auth import passwd

passwd() # 设置jupyter密码

 

# jupyter_config.py文件内容

# passwd
c.NotebookApp.password = u'xxxx'

# bind ip
c.NotebookApp.ip = 'xxxx'

# bind port
c.NotebookApp.port = xxxx

 

# 在jupyter_config.py文件所在文件夹下启动cmd

jupyter notebook --config=jupyter_config.py # 配置

http://ip:port # 浏览器启动

 

posted @ 2020-12-26 12:43  阿洛萌萌哒  阅读(73)  评论(0编辑  收藏  举报