code: def make_viewless_tensor(inp, requires_grad, keep_graph):
      """
      Entry-point for creating viewless tensors.
  
      This method should be used, rather than calling 'MakeViewlessTensor'
      or '_kernel_make_viewless_tensor' directly. This method acts as a
      switch for determining if an autograd function or a regular method
      should be used to create the tensor.
      """
  
      # return tensor as-is, if not a 'view'
      if inp._base is None:
          return inp
  
      # create viewless tensor
      if keep_graph:
          return MakeViewlessTensor.apply(inp, requires_grad)
      else:
          return _kernel_make_viewless_tensor(inp, requires_grad)
  
imports: import math
  import operator
  from functools import reduce
  import torch
  from megatron.core import parallel_state
  from megatron.core.dist_checkpointing.mapping import ShardedTensor
label_desc: Use image node_id 7 for calling a global function with example usage: make_viewless_tensor(inp, requires_grad, keep_graph) and returns: inp, MakeViewlessTensor, _kernel_make_viewless_tensor