@@ -1945,7 +1945,8 @@ def repeat(a, repeats, axis=None):
1945
1945
1946
1946
def require (a , dtype = None , requirements = None , * , like = None ):
1947
1947
"""
1948
- Return an dpnp.ndarray of the provided type that satisfies requirements.
1948
+ Return a :class:`dpnp.ndarray` of the provided type that satisfies
1949
+ requirements.
1949
1950
1950
1951
This function is useful to be sure that an array with the correct flags
1951
1952
is returned for passing to compiled code (perhaps through ctypes).
@@ -1956,11 +1957,9 @@ def require(a, dtype=None, requirements=None, *, like=None):
1956
1957
----------
1957
1958
a : array_like
1958
1959
The object to be converted to a type-and-requirement-satisfying array.
1959
- dtype : data-type, optional
1960
- The required data-type. If None preserve the current dtype. If your
1961
- application requires the data to be in native byteorder, include
1962
- a byteorder specification as a part of the dtype specification.
1963
- requirements : {str, sequence of str}, , optional
1960
+ dtype : {None, data-type}, optional
1961
+ The required data-type. If ``None`` preserve the current dtype.
1962
+ requirements : {None, str, sequence of str}, optional
1964
1963
The requirements list can be any of the following:
1965
1964
1966
1965
* 'F_CONTIGUOUS' ('F') - ensure a Fortran-contiguous array
@@ -1980,7 +1979,7 @@ def require(a, dtype=None, requirements=None, *, like=None):
1980
1979
See Also
1981
1980
--------
1982
1981
:obj:`dpnp.asarray` : Convert input to an ndarray.
1983
- :obj:`dpnp.asanyarray ` : Convert to an ndarray, but pass through
1982
+ :obj:`dpnp.asanyarray` : Convert to an ndarray, but pass through
1984
1983
ndarray subclasses.
1985
1984
:obj:`dpnp.ascontiguousarray` : Convert input to a contiguous array.
1986
1985
:obj:`dpnp.asfortranarray` : Convert input to an ndarray with
@@ -1996,7 +1995,7 @@ def require(a, dtype=None, requirements=None, *, like=None):
1996
1995
Examples
1997
1996
--------
1998
1997
>>> import dpnp as np
1999
- >>> x = np.arange(6).reshape(2,3)
1998
+ >>> x = np.arange(6).reshape(2, 3)
2000
1999
>>> x.flags
2001
2000
C_CONTIGUOUS : True
2002
2001
F_CONTIGUOUS : False
0 commit comments