This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import torch.nn as nn | |
import torch.nn.init as init | |
import torch.nn.functional as F | |
class _NonLocalBlockND(nn.Module): | |
def __init__(self, in_channels, inter_channels=None, dimension=3, sub_sample=True, bn_layer=True): | |
super(_NonLocalBlockND, self).__init__() | |
assert dimension in [1, 2, 3] |
OlderNewer