上传者: 42099302
|
上传时间: 2021-10-12 11:48:21
|
文件大小: 69KB
|
文件类型: -
HaloNet-火炬
本文的注意力层的实现,。 该存储库将仅容纳关注层,而不会包含更多内容。
安装
$ pip install halonet-pytorch
用法
import torch
from halonet_pytorch import HaloAttention
attn = HaloAttention (
dim = 512 , # dimension of feature map
block_size = 8 , # neighborhood block size (feature map must be divisible by this)
halo_size = 4 , # halo size (block receptive field)
dim_head = 64 , # dimension of