code: def _check_forward_mode_input_array(self, X: np.ndarray) -> int:
          
          # Find the length of each variable to infer T
          if not isinstance(X, np.ndarray):
              raise ValueError('X must be a numpy array, dict, or scalar')
          # Get the shape and tensor rank
          shape = X.shape
          tensor_rank = len(shape)
          T = 0
          # Only 1D and 2D arrays are supported
          if tensor_rank not in (0, 1, 2):
              raise ValueError(f'Shape of X = {X.shape}. Numpy array must be a 1D vector or 2D matrix')        
          if tensor_rank == 0:
              T = 1
          # If the input was a 1D vector, its length must EITHER (1) be T, or (2) m, with T == 1
          if tensor_rank == 1 and (shape[0] != self.m) and self.m != 1:
              raise ValueError(f'Error: X has shape {X.shape}, incompatible with m = {self.m} on fluxion.')
          # Return the value of T in this situation
          if tensor_rank == 1 and shape[0] == self.m:
              T = 1
          if tensor_rank == 1 and self.m == 1:
              T = shape[0]
          # If the input was a 2D vector, it must be of shape Txn
          if tensor_rank == 2 and (shape[1] != self.m):
              raise ValueError(f'Error: X has shape {X.shape}, incompatible with m = {self.m} on fluxion.')
          if tensor_rank == 2:
              T = shape[0]
          return T
docs: Check whether one forward mode input array is of valid shape
          Returns inferred value of T