code: def as_strided(input, size, stride, storage_offset=None):
      ind = ivy.array([0], dtype=ivy.int64)
      for i, (size_i, stride_i) in enumerate(zip(size, stride)):
          r_size = [1] * len(stride)
          r_size[i] = -1
          ind = ind + ivy.reshape(ivy.arange(size_i), r_size) * stride_i
      if storage_offset:
          ind = ind + storage_offset
      # in case the input is a non-contiguous native array,
      # the return will differ from torch.as_strided
      if ivy.is_ivy_array(input) and input.base is not None:
          return ivy.gather(ivy.flatten(input.base), ind)
      return ivy.gather(ivy.flatten(input), ind)
  
imports: import ivy
  from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back, to_ivy_shape
  from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
  import ivy.functional.frontends.torch
label_desc: Use image node_id 2 for calling a global function with example usage: as_strided(input, size, stride, storage_offset) and returns: ivy, ivy