920232796 / NestedFormer

NestedFormer: Nested Modality-Aware Transformer for Brain Tumor Segmentation (MICCAI 2022)
Apache License 2.0
38 stars 4 forks source link

NMaFaLayer模块中的 WindowAttention类中代码报错 #6

Open wzhangck opened 1 year ago

wzhangck commented 1 year ago

你好,根据你提供的示例代码,我运行 WindowAttention类的“ dots += self.pos_embedding[self.relative_indices[:, :, 0],self.relative_indices[:, :, 1],self.relative_indices[:, :, 2]]”这句代码时报错了,显示“tensors used as indices must be long, byte or bool tensors”,请问你知道该怎么解决吗?

920232796 commented 1 year ago

看这个错误好像是relative_indices计算的有问题?你能详细的说一下你怎么做的么?