#NEWLINE# def atleast_3d( * arys ) : #NEWLINE# #INDENT# 'Converts arrays to arrays with dimensions >= 3.\n\n    If an input array has dimensions less than three, then this function\n    inserts new axes to make it have three dimensions. The place of the new\n    axes are following:\n\n    - If its shape is ``()``, then the shape of output is ``(1, 1, 1)``.\n    - If its shape is ``(N,)``, then the shape of output is ``(1, N, 1)``.\n    - If its shape is ``(M, N)``, then the shape of output is ``(M, N, 1)``.\n    - Otherwise, the output is the input array itself.\n\n    Args:\n        arys (tuple of arrays): Arrays to be converted. All arguments must be\n            :class:`cupy.ndarray` objects.\n\n    Returns:\n        If there are only one input, then it returns its converted version.\n        Otherwise, it returns a list of converted arrays.\n\n    .. seealso:: :func:`numpy.atleast_3d`\n\n    ' #NEWLINE# res = [ ] #NEWLINE# for a in res : #NEWLINE# #INDENT# if ( not isinstance ( a , cupy . ndarray ) ) : #NEWLINE# #INDENT# raise TypeError ( 'Only cupy arrays can be atleast_3d' ) #NEWLINE# #UNINDENT# if ( a . ndim == 0 ) : #NEWLINE# #INDENT# a = a . reshape ( 1 , 1 , 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( a . ndim == 1 ) : #NEWLINE# #INDENT# a = a [ cupy . newaxis , : , cupy . newaxis ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( a . ndim == 2 ) : #NEWLINE# #INDENT# a = a [ : , : , cupy . newaxis ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# res . append ( a ) #NEWLINE# #UNINDENT# if ( len ( res ) == 1 ) : #NEWLINE# #INDENT# res = res [ 0 ] #NEWLINE# #UNINDENT# return res