code: def _reshape_fortran_torch(x, shape):
      if len(x.shape) > 0:
          x = x.permute(*reversed(range(len(x.shape))))
      return x.reshape(shape[::-1]).permute(
          list(range(len(shape)))[::-1]
      )
  
imports: import math
  from numbers import Number
  from typing import Union, Optional, Tuple, List, Sequence, Iterable
  import torch
  import ivy
  from ivy.func_wrapper import with_unsupported_dtypes
  from ivy.functional.ivy.manipulation import _calculate_out_shape
  from .None import backend_version
label_desc: Use image node_id 1 for calling a global function with example usage: _reshape_fortran_torch(x, shape) and returns: x