What is the reason for this error?
class Network(ResNet):
    def __init__(self, num_actions):
        self.num_actions = num_actions
        super(Network, self).__init__(BasicBlock, [2, 2, 2, 2], num_classes=self.num_actions)
        self.conv1 = torch.nn.Conv2d(1, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3), bias=False)
    def forward(self, x):
        x = x.cuda()
        batch, _ = super(Network, self).forward(x).shape
        x = super(Network, self).forward(x).view(batch, self.num_actions)
        return x

net = Network(action_dim).half().to(device)

fn = torch._C._jit_script_compile(qualified_name, ast, _rcb, get_default_args(obj))
RuntimeError:
builtin cannot be used as a value:
at /home/slavavs/anaconda3/lib/python3.7/site-packages/torchvision/models/detection/_utils.py:14:56
def zeros_like(tensor, dtype):
# type: (Tensor, int) -> Tensor
return torch.zeros_like(tensor, dtype=dtype, layout=tensor.layout,
~~~~~~~~~~~~~ <— HERE
device=tensor.device, pin_memory=tensor.is_pinned())
‘zeros_like’ is being compiled since it was called from ‘torch.torchvision.models.detection._utils.BalancedPositiveNegativeSampler.call’
at /home/slavavs/anaconda3/lib/python3.7/site-packages/torchvision/models/detection/_utils.py:72:12
        # randomly select positive and negative examples
        perm1 = torch.randperm(positive.numel(), device=positive.device)[:num_pos]
        perm2 = torch.randperm(negative.numel(), device=negative.device)[:num_neg]

        pos_idx_per_image = positive[perm1]
        neg_idx_per_image = negative[perm2]

        # create binary mask from indices
        pos_idx_per_image_mask = zeros_like(
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...  <--- HERE
            matched_idxs_per_image, dtype=torch.uint8
        )
        neg_idx_per_image_mask = zeros_like(
            matched_idxs_per_image, dtype=torch.uint8
        )

        pos_idx_per_image_mask[pos_idx_per_image] = torch.tensor(1, dtype=torch.uint8)
        neg_idx_per_image_mask[neg_idx_per_image] = torch.tensor(1, dtype=torch.uint8)