mirror of
https://github.com/wassname/Brukino_AntiPaSTO_Appetizer.git
synced 2026-06-27 14:13:15 +08:00
6 lines
118 B
Python
6 lines
118 B
Python
import torch
|
|
x = torch.tensor([1.0, 2.0, 4.0, 7.0])
|
|
with torch.no_grad():
|
|
dx = torch.gradient(x)[0]
|
|
print(dx)
|