Skip to main content

Terry toolkit tkitAttNLocal,

Project description

tkitAttNLocal

构建对角线mask矩阵,用来降维相对位置数据。

安装

pip install tkitAttNLocal

import torch.nn as nn
import torch
import torch.nn.functional as F
from tkitAttNLocal import AttNLocal

# 输入维度和长度一样的矩阵
a=torch.randn(32,100,100)

attL=AttNLocal(100,10)
attL(a).size()

torch.Size([32, 100, 10])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tkitAttNLocal-0.0.0.316336997.tar.gz (7.0 kB view hashes)

Uploaded Source

Built Distribution

tkitAttNLocal-0.0.0.316336997-py3-none-any.whl (6.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page