code: def _logit(inp):
      # torch.logit is introduced in 1.7.0
      if hasattr(torch, "logit"):
          return torch.logit(inp)
      else:
          return torch.log(inp) - torch.log(1 - inp)
  
file_path: captum/captum/module/binary_concrete_stochastic_gates.py
imports: import math
  from typing import Optional
  import torch
  from captum.module.stochastic_gates_base import StochasticGatesBase
  from torch import nn, Tensor
label_desc: Use image node_id 2 for calling a global function with example usage: _logit(inp) and returns: torch, unknown