added fromiter function
@@ -160,7 +160,15 @@ def fromfunction(*args, **kwargs):
return asarray(numpy.fromfunction(*args, **kwargs))
-# TODO(okuta): Implement fromiter
+def fromiter(*args, **kwargs):
+ """Create a new 1-dimensional array from an iterable object.
+
+ .. note::
+ Uses NumPy's ``fromiter`` and coerces the result to a CuPy array.
+
+ .. seealso:: :func:`numpy.fromiter`
+ """
+ return asarray(numpy.fromiter(*args, **kwargs))
# TODO(okuta): Implement fromstring
