Hugging Face
Models
Datasets
Spaces
Community
Docs
Enterprise
Pricing
Log In
Sign Up
Datasets:
ysn-rfd
/
text-dataset-tiny-code-script-py-format
like
1
Tasks:
Text Generation
Text Classification
Zero-Shot Classification
Languages:
English
Size:
1K<n<10K
Tags:
code
License:
apache-2.0
Dataset card
Files
Files and versions
xet
Community
2
c1fcc58
text-dataset-tiny-code-script-py-format
/
pytorch_study
/
day1_1.py
ysn-rfd
Upload 26 files
835424e
verified
3 months ago
raw
Copy download link
history
blame
Safe
260 Bytes
import
torch
as
t
import
torch.nn
as
nn
import
numpy
as
np
x = t.tensor(
1.
, requires_grad=
True
)
w = t.tensor(
2.
, requires_grad=
True
)
b = t.tensor(
3.
, requires_grad=
True
)
y = w*x+b
y.backward()
print
(x.grad)
print
(w.grad)
print
(b.grad)