Repository: ivy-llc/ivy

Issue:
is_float_dtype



Discussion:

Resolving patch:
diff --git a/ivy/data_classes/array/data_type.py b/ivy/data_classes/array/data_type.py
--- a/ivy/data_classes/array/data_type.py
+++ b/ivy/data_classes/array/data_type.py
@@ -252,7 +252,7 @@ def is_float_dtype(self: ivy.Array) -> bool:
         Parameters
         ----------
         self
-            input array from which to check for float dtype.
+            Input array from which to check for float dtype.
 
         Returns
         -------
@@ -262,8 +262,12 @@ def is_float_dtype(self: ivy.Array) -> bool:
         Examples
         --------
         >>> x = ivy.array([1, 2, 3], dtype=ivy.int8)
-        >>> x.is_float_dtype()
+        >>> print(x.is_float_dtype())
         False
+
+        >>> x = ivy.array([2.3, 4.5, 6.8], dtype=ivy.float32)
+        >>> print( x.is_float_dtype())
+        True
         """
         return ivy.is_float_dtype(self._data)
 
diff --git a/ivy/data_classes/container/data_type.py b/ivy/data_classes/container/data_type.py
--- a/ivy/data_classes/container/data_type.py
+++ b/ivy/data_classes/container/data_type.py
@@ -123,7 +123,7 @@ def astype(
             otherwise, a newly allocated must be returned. Default: ``True``.
         out
             optional output array, for writing the result to. It must have a shape
-             that the inputs broadcast to.
+            that the inputs broadcast to.
 
         Returns
         -------
@@ -702,9 +702,9 @@ def _static_finfo(
         >>> print(y)
         {
             x: finfo(resolution=0.001, min=-6.55040e+04, max=6.55040e+04,\
-                     dtype=float16),
+                    dtype=float16),
             y: finfo(resolution=1e-15, min=-1.7976931348623157e+308, \
-               max=1.7976931348623157e+308, dtype=float64)
+                max=1.7976931348623157e+308, dtype=float64)
         }
         """
         return ContainerBase.cont_multi_map_in_function(
@@ -747,9 +747,9 @@ def finfo(
         >>> print(c.finfo())
         {
             x: finfo(resolution=0.001, min=-6.55040e+04, max=6.55040e+04,\
-                     dtype=float16),
+                    dtype=float16),
             y: finfo(resolution=1e-15, min=-1.7976931348623157e+308, \
-               max=1.7976931348623157e+308, dtype=float64)
+                max=1.7976931348623157e+308, dtype=float64)
         }
         """
         return self._static_finfo(
@@ -809,10 +809,10 @@ def _static_iinfo(
         ...                   y=ivy.array([-40000,99,1], dtype=ivy.int32))
         >>> y = ivy.Container.static_iinfo(c)
         >>> print(y)
-         {
+        {
             x: iinfo(min=-32768, max=32767, dtype=int16),
             y: iinfo(min=-2147483648, max=2147483647, dtype=int32)
-         }
+        }
         """
         return ContainerBase.cont_multi_map_in_function(
             "iinfo",
diff --git a/ivy/functional/ivy/data_type.py b/ivy/functional/ivy/data_type.py
--- a/ivy/functional/ivy/data_type.py
+++ b/ivy/functional/ivy/data_type.py
@@ -478,8 +478,8 @@ def broadcast_to(
     >>> y = ivy.broadcast_to(x, (3, 3))
     >>> print(y)
     ivy.array([[1, 2, 3],
-               [1, 2, 3],
-               [1, 2, 3]])
+            [1, 2, 3],
+            [1, 2, 3]])
 
     With :class:`ivy.NativeArray` input:
 
@@ -487,8 +487,8 @@ def broadcast_to(
     >>> y = ivy.broadcast_to(x, (3, 2))
     >>> print(y)
     ivy.array([[0.1, 0.3],
-               [0.1, 0.3],
-               [0.1, 0.3]])
+            [0.1, 0.3],
+            [0.1, 0.3]])
 
     With :class:`ivy.Container` input:
 
@@ -498,11 +498,11 @@ def broadcast_to(
     >>> print(y)
     {
         a: ivy.array([[1, 2, 3],
-                      [1, 2, 3],
-                      [1, 2, 3]]),
+                    [1, 2, 3],
+                    [1, 2, 3]]),
         b: ivy.array([[4, 5, 6],
-                      [4, 5, 6],
-                      [4, 5, 6]])
+                    [4, 5, 6],
+                    [4, 5, 6]])
     }
     """
     return current_backend(x).broadcast_to(x, shape, out=out)
@@ -547,7 +547,7 @@ def can_cast(
 
     Examples
     --------
-     With :class:`ivy.Dtype` input:
+    With :class:`ivy.Dtype` input:
 
     >>> print(ivy.can_cast(ivy.uint8, ivy.int32))
     True
@@ -608,24 +608,24 @@ def finfo(
 
         - **bits**: *int*
 
-          number of bits occupied by the floating-point data type.
+        number of bits occupied by the floating-point data type.
 
         - **eps**: *float*
 
-          difference between 1.0 and the next smallest representable floating-point
-          number larger than 1.0 according to the IEEE-754 standard.
+        difference between 1.0 and the next smallest representable floating-point
+        number larger than 1.0 according to the IEEE-754 standard.
 
         - **max**: *float*
 
-          largest representable number.
+        largest representable number.
 
         - **min**: *float*
 
-          smallest representable number.
+        smallest representable number.
 
         - **smallest_normal**: *float*
 
-          smallest positive floating-point number with full precision.
+        smallest positive floating-point number with full precision.
 
 
     This function conforms to the `Array API Standard
@@ -667,7 +667,7 @@ def finfo(
     {
         x: finfo(resolution=0.001, min=-6.55040e+04, max=6.55040e+04, dtype=float16),
         y: finfo(resolution=1e-15, min=-1.7976931348623157e+308, /
-           max=1.7976931348623157e+308, dtype=float64)
+            max=1.7976931348623157e+308, dtype=float64)
     }
     """
     return current_backend(None).finfo(type)
@@ -696,15 +696,15 @@ def iinfo(
 
         - **bits**: *int*
 
-          number of bits occupied by the type.
+        number of bits occupied by the type.
 
         - **max**: *int*
 
-          largest representable number.
+        largest representable number.
 
         - **min**: *int*
 
-          smallest representable number.
+        smallest representable number.
 
 
     This function conforms to the `Array API Standard
@@ -763,8 +763,8 @@ def result_type(
     :ref:`type-promotion`) to the arguments.
 
     .. note::
-       If provided mixed dtypes (e.g., integer and floating-point), the returned dtype
-       will be implementation-specific.
+    If provided mixed dtypes (e.g., integer and floating-point), the returned dtype
+    will be implementation-specific.
 
     Parameters
     ----------


Test patch: