/
vuron
/
adept
Обзор
Документация
Войти
/
vuron
/
adept
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
with_cpu
python/torch_refs/torch_pool.py
17 строк
295 B
kolkir
Refactor python folder structure
01 мар 2025, 22:16
01 мар 2025, 22:16
ef25f05
Код
Авторство
О чём код?
import torch import torch.nn.functional as F im = torch.tensor( [[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]]], dtype=torch.float32, requires_grad=True ) print(im.shape) # out = F.avg_pool2d(im, 2, 1) out = F.max_pool2d(im, 2, 1) print(out.shape) print(out) out.mean().backward() print(im.grad)