'convert array sequence to a sequence of arrays with at least 3d dims'

def convert_seq_to_atleast_3d(self, seq_arg_var):

    arr_args = self._get_sequence_arrs(seq_arg_var.name)
    new_seq = []
    for arr in arr_args:
        curr_dims = self._get_ndims(arr.name)
        if (curr_dims < 3):
            dummy_var = ir.Var(arr.scope, mk_unique_var('__dummy_nd'), arr.loc)
            self.typemap[dummy_var.name] = self.typemap[arr.name].copy(ndim=3)
            corrs = self.array_shape_classes[arr.name].copy()
            if (curr_dims == 0):
                corrs = ([CONST_CLASS] * 3)
            elif (curr_dims == 1):
                corrs = (([CONST_CLASS] + corrs) + [CONST_CLASS])
            elif (curr_dims == 2):
                corrs = (corrs + [CONST_CLASS])
            self.array_shape_classes[dummy_var.name] = corrs
            new_seq.append(dummy_var)
        else:
            new_seq.append(arr)
    tup_name = mk_unique_var('__dummy_tup')
    self.tuple_table[tup_name] = new_seq
    return ir.Var(arr_args[0].scope, tup_name, arr_args[0].loc)
