def _parse_var_array(self, X: np.ndarray) -> dict:
        """
        Unpack the numpy array and bind each column to one of the variables in self.var_names
        Returns inferred dict of variable: val pairs
        """
        arg_vars = {}
        # Get the shape and tensor rank
        shape = X.shape
        tensor_rank = len(shape)
        T = self._check_forward_mode_input_array(X)
        if tensor_rank == 0:
            #there is only 1 var name, so this will only run once
            for var_name in self.var_names:
                arg_vars[var_name] = X
        if tensor_rank == 1 and T == shape[0]:
            #there is only 1 var name, so this will only run once
            for var_name in self.var_names:
                arg_vars[var_name] = X.squeeze()
        elif tensor_rank == 1:
            for j, var_name in enumerate(sorted(self.var_names)):
                arg_vars[var_name] = X[j].squeeze()
        elif tensor_rank == 2:
            for j, var_name in enumerate(sorted(self.var_names)):
                arg_vars[var_name] = X[:,j].squeeze()
        return arg_vars
def _parse_var_array ( self , X : np . ndarray ) -> dict : arg_vars = { } shape = X . shape tensor_rank = len ( shape ) T = self . _check_forward_mode_input_array ( X ) if tensor_rank == 0 : for var_name in self . var_names : arg_vars [ var_name ] = X if tensor_rank == 1 and T == shape [ 0 ] : for var_name in self . var_names : arg_vars [ var_name ] = X . squeeze ( ) elif tensor_rank == 1 : for j , var_name in enumerate ( sorted ( self . var_names ) ) : arg_vars [ var_name ] = X [ j ] . squeeze ( ) elif tensor_rank == 2 : for j , var_name in enumerate ( sorted ( self . var_names ) ) : arg_vars [ var_name ] = X [ : , j ] . squeeze ( ) return arg_vars
Unpack the numpy array and bind each column to one of the variables in self.var_names
        Returns inferred dict of variable: val pairs