def gradcheck(
        func: Callable[..., Union[torch.Tensor, Sequence[torch.Tensor]]],
        inputs: Union[torch.Tensor, Sequence[Any]],
        *,
        raise_exception: bool = True,
        fast_mode: bool = True,
        requires_grad: Sequence[bool] = [],
        dtypes: Sequence[Dtype] = [],
        **kwargs: Any,
    ) -> bool:
        """It will gradcheck the function using the `torch.autograd.gradcheck` method.

        By default this method will pass all tensor to `tensor_to_gradcheck_var` which casts the tensor
        to be float64 dtype, and requires grad as True. You can overwrite which tensors should have requires grad
        equals True, by using a Sequence of the same length of the sequence of inputs, within the requires_grad
        per item. You also, can overwrite with the same mechanics the dtype using the `dtypes`
        parameter.
        """
        requires_grad = requires_grad if len(requires_grad) > 0 else [True] * len(inputs)
        dtypes = dtypes if len(dtypes) > 0 else [torch.float64] * len(inputs)

        if isinstance(inputs, torch.Tensor):
            inputs = tensor_to_gradcheck_var(inputs)
        elif isinstance(inputs, dict):
            inputs = {
                k: tensor_to_gradcheck_var(v, d, r) if isinstance(v, torch.Tensor) else v
                for (k, v), d, r in zip(inputs.items(), dtypes, requires_grad)
            }
        else:
            inputs = [
                tensor_to_gradcheck_var(i, d, r) if isinstance(i, torch.Tensor) else i
                for i, r, d in zip(inputs, requires_grad, dtypes)
            ]

        return gradcheck(func, inputs, raise_exception=raise_exception, fast_mode=fast_mode, **kwargs)
It will gradcheck the function using the `torch.autograd.gradcheck` method.

        By default this method will pass all tensor to `tensor_to_gradcheck_var` which casts the tensor
        to be float64 dtype, and requires grad as True. You can overwrite which tensors should have requires grad
        equals True, by using a Sequence of the same length of the sequence of inputs, within the requires_grad
        per item. You also, can overwrite with the same mechanics the dtype using the `dtypes`
        parameter.
        
testing/base.py