    def test_non_local_block1d(self):
        """
        Test non-local block1d.
        """
        in_channels = 1
        inter_channels = None
        sub_sample = True
        bn_layer = True
        net = NONLocalBlock1D(in_channels=in_channels,
                              inter_channels=inter_channels,
                              sub_sample=sub_sample,
                              bn_layer=bn_layer)
        input_tensor = torch.randn(1, 1, 4)
        output_tensor = net(input_tensor)
        self.assertTrue(output_tensor.shape == torch.Size([1, 1, 4]))
Test non-local block1d.
tests/unittests/models/layers/test_non_local.py