判断网络是否因果(causal)
import numpy as np
x = torch.randn(1, 4, 257, 251) # [B, C, F, T]
x[:, :, :, -1:] = np.inf
encoder = Encoder_Block().eval()
with torch.no_grad():
R1, R2, R3 = encoder(x) # R1:[1, 16, 10, 257] R2:[1, 32, 10, 129] R3:[1, 64, 10, 65]
print(R3)
print(R1.shape, R2.shape, R3.shape)

浙公网安备 33010602011771号