code: def constant_(tensor: Tensor, val: float) -> Tensor:
      r"""Fill the input Tensor with the value :math:`\text{val}`.
  
      Args:
          tensor: an n-dimensional `torch.Tensor`
          val: the value to fill the tensor with
  
      Examples:
          >>> w = torch.empty(3, 5)
          >>> nn.init.constant_(w, 0.3)
      """
      if torch.overrides.has_torch_function_variadic(tensor):
          return torch.overrides.handle_torch_function(
              constant_, (tensor,), tensor=tensor, val=val
          )
      return _no_grad_fill_(tensor, val)
  
imports: import math
  import warnings
  from torch import Tensor
  import torch
  from typing import Optional
label_desc: Use image node_id 10 for calling a global function with example usage: constant_(tensor, val) and returns: _no_grad_fill_, torch