text stringlengths 17 362k | id stringlengths 13 115 | metadata dict | __index_level_0__ int64 0 75 |
|---|---|---|---|
# global
from typing import Optional, Tuple
import torch
def unravel_index(
indices: torch.Tensor,
shape: Tuple[int],
/,
*,
out: Optional[torch.Tensor] = None,
) -> Tuple[torch.Tensor]:
temp = indices.to(torch.int32)
output = []
for dim in reversed(shape):
output.append(temp % ... | ivy/ivy/functional/backends/torch/experimental/searching.py/0 | {
"file_path": "ivy/ivy/functional/backends/torch/experimental/searching.py",
"repo_id": "ivy",
"token_count": 174
} | 26 |
# global
import torch
from typing import Optional, Literal, Union, List
# local
import ivy
from ivy.func_wrapper import with_unsupported_dtypes
from . import backend_version
@with_unsupported_dtypes({"2.2 and below": ("complex",)}, backend_version)
def argsort(
x: torch.Tensor,
/,
*,
axis: int = -1,
... | ivy/ivy/functional/backends/torch/sorting.py/0 | {
"file_path": "ivy/ivy/functional/backends/torch/sorting.py",
"repo_id": "ivy",
"token_count": 1426
} | 27 |
# global
# local
import ivy
import ivy.functional.frontends.jax as jax_frontend
from ivy.func_wrapper import with_unsupported_dtypes
class Array:
def __init__(self, array, weak_type=False):
self._ivy_array = array if isinstance(array, ivy.Array) else ivy.array(array)
self.weak_type = weak_type
... | ivy/ivy/functional/frontends/jax/array.py/0 | {
"file_path": "ivy/ivy/functional/frontends/jax/array.py",
"repo_id": "ivy",
"token_count": 5697
} | 28 |
# global
import inspect
import abc
# local
import ivy
from ivy.functional.frontends.jax.func_wrapper import (
to_ivy_arrays_and_back,
)
from .creation import linspace, arange, array
from .manipulations import transpose, concatenate, expand_dims
class _AxisConcat(abc.ABC):
axis: int
ndmin: int
trans1d... | ivy/ivy/functional/frontends/jax/numpy/indexing.py/0 | {
"file_path": "ivy/ivy/functional/frontends/jax/numpy/indexing.py",
"repo_id": "ivy",
"token_count": 2762
} | 29 |
# local
import ivy
from ivy.func_wrapper import with_supported_dtypes
from ivy.functional.frontends.paddle.func_wrapper import to_ivy_arrays_and_back
from ivy.functional.ivy.experimental.layers import _broadcast_pooling_helper
# --- Helpers --- #
# --------------- #
def _conv(input, weight, bias=None, stride=1, pad... | ivy/ivy/functional/frontends/mindspore/ops/function/nn_func.py/0 | {
"file_path": "ivy/ivy/functional/frontends/mindspore/ops/function/nn_func.py",
"repo_id": "ivy",
"token_count": 5949
} | 30 |
from . import from_shape_or_value
from .from_shape_or_value import *
from . import from_existing_data
from .from_existing_data import *
from . import numerical_ranges
from .numerical_ranges import *
from . import building_matrices
from .building_matrices import *
from . import matrix_class
from .matrix_class import *
| ivy/ivy/functional/frontends/numpy/creation_routines/__init__.py/0 | {
"file_path": "ivy/ivy/functional/frontends/numpy/creation_routines/__init__.py",
"repo_id": "ivy",
"token_count": 94
} | 31 |
import inspect
import ivy
from ivy.functional.frontends.numpy.func_wrapper import (
to_ivy_arrays_and_back,
)
@to_ivy_arrays_and_back
def diag_indices(n, ndim=2):
idx = ivy.arange(n)
res = ivy.array((idx,) * ndim)
res = tuple(res.astype("int64"))
return res
@to_ivy_arrays_and_back
def indices(d... | ivy/ivy/functional/frontends/numpy/indexing_routines/generating_index_arrays.py/0 | {
"file_path": "ivy/ivy/functional/frontends/numpy/indexing_routines/generating_index_arrays.py",
"repo_id": "ivy",
"token_count": 610
} | 32 |
# global
import ivy
from ivy.functional.frontends.numpy.func_wrapper import (
to_ivy_arrays_and_back,
handle_numpy_casting,
handle_numpy_dtype,
from_zero_dim_arrays_to_scalar,
handle_numpy_out,
)
# --- Helpers --- #
# --------------- #
@handle_numpy_out
@handle_numpy_dtype
@to_ivy_arrays_and_bac... | ivy/ivy/functional/frontends/numpy/logic/logical_operations.py/0 | {
"file_path": "ivy/ivy/functional/frontends/numpy/logic/logical_operations.py",
"repo_id": "ivy",
"token_count": 1007
} | 33 |
# local
import ivy
from ivy.functional.frontends.numpy.func_wrapper import (
to_ivy_arrays_and_back,
)
@to_ivy_arrays_and_back
def pad(array, pad_width, mode="constant", **kwargs):
return ivy.pad(array, pad_width, mode=mode, **kwargs)
| ivy/ivy/functional/frontends/numpy/manipulation_routines/padding_arrays.py/0 | {
"file_path": "ivy/ivy/functional/frontends/numpy/manipulation_routines/padding_arrays.py",
"repo_id": "ivy",
"token_count": 100
} | 34 |
# global
import ivy
# local
from ivy.functional.frontends.numpy.func_wrapper import (
to_ivy_arrays_and_back,
handle_numpy_dtype,
from_zero_dim_arrays_to_scalar,
handle_numpy_out,
)
import ivy.functional.frontends.numpy as np_frontend
@handle_numpy_out
@handle_numpy_dtype
@to_ivy_arrays_and_back
def ... | ivy/ivy/functional/frontends/numpy/mathematical_functions/sums_products_differences.py/0 | {
"file_path": "ivy/ivy/functional/frontends/numpy/mathematical_functions/sums_products_differences.py",
"repo_id": "ivy",
"token_count": 2315
} | 35 |
# local
import ivy
from ivy.functional.frontends.numpy import promote_types_of_numpy_inputs
from ivy.functional.frontends.numpy.func_wrapper import (
to_ivy_arrays_and_back,
from_zero_dim_arrays_to_scalar,
handle_numpy_out,
)
# --- Helpers --- #
# --------------- #
# nanargmin and nanargmax compositi... | ivy/ivy/functional/frontends/numpy/sorting_searching_counting/searching.py/0 | {
"file_path": "ivy/ivy/functional/frontends/numpy/sorting_searching_counting/searching.py",
"repo_id": "ivy",
"token_count": 1190
} | 36 |
import sys
import ivy
from ivy.utils.exceptions import handle_exceptions
from ivy.functional.frontends import set_frontend_to_specific_version
# global
from numbers import Number
from typing import Union, Tuple, Iterable
# Constructing dtypes are required as ivy.<dtype>
# will change dynamically on the backend and ... | ivy/ivy/functional/frontends/paddle/__init__.py/0 | {
"file_path": "ivy/ivy/functional/frontends/paddle/__init__.py",
"repo_id": "ivy",
"token_count": 3090
} | 37 |
# global
from ..search import * # noqa: F401
| ivy/ivy/functional/frontends/paddle/tensor/search.py/0 | {
"file_path": "ivy/ivy/functional/frontends/paddle/tensor/search.py",
"repo_id": "ivy",
"token_count": 16
} | 38 |
# global
import ivy
atto = ivy.atto
centi = ivy.centi
deci = ivy.deci
deka = ivy.deka
exa = ivy.exa
exbi = ivy.exbi
femto = ivy.femto
gibi = ivy.gibi
giga = ivy.giga
golden = ivy.golden
golden_ratio = ivy.golden_ratio
hecto = ivy.hecto
# Binary prefixes #
# ------#
kibi = ivy.kibi
kilo = ivy.kilo
mebi = ivy.mebi
mega... | ivy/ivy/functional/frontends/scipy/constants/constants.py/0 | {
"file_path": "ivy/ivy/functional/frontends/scipy/constants/constants.py",
"repo_id": "ivy",
"token_count": 362
} | 39 |
from .stats import *
from . import contingency
from . import distributions
from . import mstats
from . import qmc
from . import sampling
| ivy/ivy/functional/frontends/scipy/stats/__init__.py/0 | {
"file_path": "ivy/ivy/functional/frontends/scipy/stats/__init__.py",
"repo_id": "ivy",
"token_count": 33
} | 40 |
from ivy.functional.frontends.sklearn.base import BaseEstimator, TransformerMixin
import ivy
class LabelEncoder(TransformerMixin, BaseEstimator):
def fit(self, y):
shape = y.shape
if len(shape) == 2 and shape[1] == 1:
y = y.reshape(-1)
elif len(shape) != 1:
raise Va... | ivy/ivy/functional/frontends/sklearn/preprocessing/_label.py/0 | {
"file_path": "ivy/ivy/functional/frontends/sklearn/preprocessing/_label.py",
"repo_id": "ivy",
"token_count": 268
} | 41 |
# global
import inspect
from typing import Callable, Dict, Optional
import functools
# local
import ivy
import ivy.functional.frontends.tensorflow as frontend
import ivy.functional.frontends.numpy as np_frontend
# --- Helpers --- #
# --------------- #
def _ivy_array_to_tensorflow(x):
if isinstance(x, ivy.Array... | ivy/ivy/functional/frontends/tensorflow/func_wrapper.py/0 | {
"file_path": "ivy/ivy/functional/frontends/tensorflow/func_wrapper.py",
"repo_id": "ivy",
"token_count": 3218
} | 42 |
from . import ragged
| ivy/ivy/functional/frontends/tensorflow/ragged/__init__.py/0 | {
"file_path": "ivy/ivy/functional/frontends/tensorflow/ragged/__init__.py",
"repo_id": "ivy",
"token_count": 6
} | 43 |
# global
import functools
from typing import Callable
# local
import ivy
import ivy.functional.frontends.torch as torch_frontend
numpy_compatible_args = {
"axis": "dim",
"keepdims": "keepdim",
"x": "input",
"a": "input",
"x1": "input",
"x2": "other",
}
class AccumulateGrad:
def __init__... | ivy/ivy/functional/frontends/torch/func_wrapper.py/0 | {
"file_path": "ivy/ivy/functional/frontends/torch/func_wrapper.py",
"repo_id": "ivy",
"token_count": 5148
} | 44 |
import ivy
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_supported_dtypes
@to_ivy_arrays_and_back
def embedding(
input,
weight,
padding_idx=None,
max_norm=None,
norm_type=2.0,
scale_grad_by_freq=False,
sparse=False,
):
... | ivy/ivy/functional/frontends/torch/nn/functional/sparse_functions.py/0 | {
"file_path": "ivy/ivy/functional/frontends/torch/nn/functional/sparse_functions.py",
"repo_id": "ivy",
"token_count": 605
} | 45 |
from . import core
from .core import *
from . import gbm
from .gbm import *
from . import linear
from .linear import *
from . import objective
from .objective import *
from . import sklearn
from .sklearn import *
from . import training
from .training import *
_frontend_array = DMatrix
| ivy/ivy/functional/frontends/xgboost/__init__.py/0 | {
"file_path": "ivy/ivy/functional/frontends/xgboost/__init__.py",
"repo_id": "ivy",
"token_count": 82
} | 46 |
# global
import ast
import logging
import inspect
import math
import functools
from numbers import Number
from typing import Union, Tuple, List, Optional, Callable, Iterable, Any
import numpy as np
import importlib
# local
import ivy
from ivy.utils.backend import current_backend
from ivy.func_wrapper import (
hand... | ivy/ivy/functional/ivy/data_type.py/0 | {
"file_path": "ivy/ivy/functional/ivy/data_type.py",
"repo_id": "ivy",
"token_count": 33761
} | 47 |
# global
import ivy
from ivy.func_wrapper import handle_array_function
from ivy.functional.ivy.gradients import gradient_descent_update
from ivy.utils.exceptions import handle_exceptions
# local
from typing import Optional, Union, Callable, Tuple, Any
# Extra #
# ------#
# Private #
def _compute_cost_and_update_gr... | ivy/ivy/functional/ivy/meta.py/0 | {
"file_path": "ivy/ivy/functional/ivy/meta.py",
"repo_id": "ivy",
"token_count": 11923
} | 48 |
"""Base class for deriving trainable modules."""
# global
from collections import OrderedDict
import os
import copy
import dill
from typing import Optional, Tuple, Dict
# local
import ivy
from ivy.data_classes.container import Container
from ivy.functional.ivy.gradients import _is_variable
from ivy.stateful.helpers i... | ivy/ivy/stateful/module.py/0 | {
"file_path": "ivy/ivy/stateful/module.py",
"repo_id": "ivy",
"token_count": 14058
} | 49 |
# global
from typing import get_type_hints
# local
import ivy
def _is_optional(typ):
# noinspection PyBroadException
try:
rep = typ.__repr__().split(".")[1]
if rep.startswith("Optional") or (
rep.startswith("Union") and type(None) in typ.__args__
):
return Tru... | ivy/ivy/utils/inspection.py/0 | {
"file_path": "ivy/ivy/utils/inspection.py",
"repo_id": "ivy",
"token_count": 1483
} | 50 |
# Hypothesis strategies
from . import hypothesis_helpers
from .hypothesis_helpers import *
# Testing
from . import assertions
from .assertions import *
from . import function_testing
from .function_testing import *
from . import testing_helpers
from .testing_helpers import *
| ivy/ivy_tests/test_ivy/helpers/__init__.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/helpers/__init__.py",
"repo_id": "ivy",
"token_count": 73
} | 51 |
from abc import ABC, abstractproperty, abstractmethod
from dataclasses import dataclass
from typing import List
import ivy
@dataclass
class SupportedDeviecs:
valid_devices: List[str]
invalid_devices: List[str]
# TODO can be refactored and be constructed dynamically
@dataclass
class SupportedDtypes:
vali... | ivy/ivy_tests/test_ivy/test_frontends/config/base.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_frontends/config/base.py",
"repo_id": "ivy",
"token_count": 1442
} | 52 |
# global
from hypothesis import strategies as st
# local
import ivy_tests.test_ivy.helpers as helpers
from ivy_tests.test_ivy.helpers import handle_frontend_test
# fft
@handle_frontend_test(
fn_tree="jax.numpy.fft.fft",
dtype_values_axis=helpers.dtype_values_axis(
available_dtypes=helpers.get_dtypes(... | ivy/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_fft.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_fft.py",
"repo_id": "ivy",
"token_count": 3924
} | 53 |
import numpy
from ivy_tests.test_ivy.test_frontends import NativeClass
numpy_classes_to_ivy_classes = {numpy._NoValue: None}
def convnumpy(argument):
"""Convert NativeClass in argument to ivy frontend counterpart for
numpy."""
if isinstance(argument, NativeClass):
return numpy_classes_to_ivy_cla... | ivy/ivy_tests/test_ivy/test_frontends/test_numpy/__init__.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_frontends/test_numpy/__init__.py",
"repo_id": "ivy",
"token_count": 129
} | 54 |
# global
import numpy as np
from hypothesis import strategies as st
# local
import ivy_tests.test_ivy.helpers as helpers
from ivy_tests.test_ivy.helpers import handle_frontend_test
# --- Helpers --- #
# --------------- #
# resize
@st.composite
def dtype_and_resize(draw):
dtype, x = draw(
helpers.dtype_... | ivy/ivy_tests/test_ivy/test_frontends/test_numpy/test_manipulation_routines/test_changing_array_shape.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_frontends/test_numpy/test_manipulation_routines/test_changing_array_shape.py",
"repo_id": "ivy",
"token_count": 4373
} | 55 |
# global
from hypothesis import assume, strategies as st
import numpy as np
# local
import ivy_tests.test_ivy.helpers as helpers
import ivy_tests.test_ivy.test_frontends.test_numpy.helpers as np_frontend_helpers
from ivy_tests.test_ivy.helpers import handle_frontend_test
import ivy
# --- Helpers --- #
# ------------... | ivy/ivy_tests/test_ivy/test_frontends/test_numpy/test_mathematical_functions/test_miscellaneous.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_frontends/test_numpy/test_mathematical_functions/test_miscellaneous.py",
"repo_id": "ivy",
"token_count": 10471
} | 56 |
import hypothesis.extra.numpy as hnp
from hypothesis import strategies as st
import numpy as np
# local
import ivy_tests.test_ivy.helpers as helpers
from ivy_tests.test_ivy.helpers import handle_frontend_test
# --- Helpers --- #
# --------------- #
@st.composite
def _broadcastable_trio(draw):
dtype = draw(help... | ivy/ivy_tests/test_ivy/test_frontends/test_numpy/test_sorting_searching_counting/test_searching.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_frontends/test_numpy/test_sorting_searching_counting/test_searching.py",
"repo_id": "ivy",
"token_count": 5148
} | 57 |
# global
from hypothesis import strategies as st
# local
import ivy_tests.test_ivy.helpers as helpers
import ivy_tests.test_ivy.helpers.globals as test_globals
from ivy_tests.test_ivy.helpers import handle_frontend_test, BackendHandler
# --- Helpers --- #
# --------------- #
@st.composite
def _input_fill_and_dtype... | ivy/ivy_tests/test_ivy/test_frontends/test_paddle/test_creation.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_frontends/test_paddle/test_creation.py",
"repo_id": "ivy",
"token_count": 9079
} | 58 |
# global
import ivy
from hypothesis import assume, strategies as st
# local
import ivy_tests.test_ivy.helpers as helpers
from ivy_tests.test_ivy.helpers import handle_frontend_test
# --- Helpers --- #
# --------------- #
@st.composite
def _affine_grid_helper(draw):
align_corners = draw(st.booleans())
dims ... | ivy/ivy_tests/test_ivy/test_frontends/test_paddle/test_nn/test_functional/test_vision.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_frontends/test_paddle/test_nn/test_functional/test_vision.py",
"repo_id": "ivy",
"token_count": 2970
} | 59 |
from ivy_tests.test_ivy.test_frontends import NativeClass
scipy_classes_to_ivy_classes = {}
def convscipy(argument):
"""Convert NativeClass in argument to ivy frontend counterpart for
scipy."""
if isinstance(argument, NativeClass):
return scipy_classes_to_ivy_classes.get(argument._native_class)
... | ivy/ivy_tests/test_ivy/test_frontends/test_scipy/__init__.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_frontends/test_scipy/__init__.py",
"repo_id": "ivy",
"token_count": 121
} | 60 |
# global
from hypothesis import strategies as st
# local
import ivy_tests.test_ivy.helpers as helpers
from ivy_tests.test_ivy.helpers import handle_frontend_test
# --- Helpers --- #
# --------------- #
@st.composite
def _valid_idct(draw):
dtype, x = draw(
helpers.dtype_and_values(
available... | ivy/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_signal.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_signal.py",
"repo_id": "ivy",
"token_count": 3359
} | 61 |
# local
import ivy_tests.test_ivy.helpers as helpers
from ivy_tests.test_ivy.helpers import handle_frontend_test
@handle_frontend_test(
fn_tree="torch.special.erfcx",
dtype_and_x=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("float"),
),
)
def test_torch_erfcx(
*,
dtype_and... | ivy/ivy_tests/test_ivy/test_frontends/test_torch/test_special_funcs.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_frontends/test_torch/test_special_funcs.py",
"repo_id": "ivy",
"token_count": 335
} | 62 |
"""Collection of tests for elementwise functions."""
# global
import math
import numpy as np
from hypothesis import assume
from hypothesis import strategies as st
# local
import ivy
import ivy_tests.test_ivy.helpers as helpers
import ivy_tests.test_ivy.helpers.globals as test_globals
from ivy_tests.test_ivy.helpers ... | ivy/ivy_tests/test_ivy/test_functional/test_core/test_elementwise.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_functional/test_core/test_elementwise.py",
"repo_id": "ivy",
"token_count": 27905
} | 63 |
# global
import os
import queue
import pytest
import random
import numpy as np
import multiprocessing
import pickle
# local
import ivy
from ivy.functional.ivy.gradients import _variable
from ivy.data_classes.container import Container
from ivy.utils.exceptions import IvyException
def test_container_all_false(on_devi... | ivy/ivy_tests/test_ivy/test_misc/test_container.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_misc/test_container.py",
"repo_id": "ivy",
"token_count": 61238
} | 64 |
"""Collection of tests for unified neural network activations."""
# global
from hypothesis import strategies as st, assume
# local
import ivy_tests.test_ivy.helpers as helpers
from ivy_tests.test_ivy.helpers import handle_method
# ELU
@handle_method(
method_tree="stateful.activations.ELU.__call__",
dtype_an... | ivy/ivy_tests/test_ivy/test_stateful/test_activations.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_stateful/test_activations.py",
"repo_id": "ivy",
"token_count": 11062
} | 65 |
import sys
from get_all_tests import BACKENDS
def main():
if len(sys.argv) < 2:
return
test = sys.argv[1]
with open("tests_to_run", "w") as f:
if "," in test:
f.write(test + "\n")
else:
for backend in BACKENDS:
f.write(f"{test},{backend}\n")
... | ivy/scripts/setup_tests/setup_tests.py/0 | {
"file_path": "ivy/scripts/setup_tests/setup_tests.py",
"repo_id": "ivy",
"token_count": 188
} | 66 |
<component name="InspectionProjectProfileManager">
<settings>
<option name="PROJECT_PROFILE" value="Default" />
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
| ivy/.idea/inspectionProfiles/profiles_settings.xml/0 | {
"file_path": "ivy/.idea/inspectionProfiles/profiles_settings.xml",
"repo_id": "ivy",
"token_count": 78
} | 0 |
> 🚀 We are granting access to **Ivy\'s Tracer and Transpiler**
> to all of our users, [sign up on our console](https://console.unify.ai/) if you
> want to test them out!
<img class="only-dark" width="100%" src="https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logo_dark.png#gh-dar... | ivy/README.md/0 | {
"file_path": "ivy/README.md",
"repo_id": "ivy",
"token_count": 17922
} | 1 |
Building the Docs
=================
This document describes how to build the Ivy docs. If you want to know more about how
our custom building pipeline work, check our `Building the Docs Pipeline
<../deep_dive/building_the_docs_pipeline.rst>`_ deep dive
.. warning::
Be aware that the doc-builder was developed ori... | ivy/docs/overview/contributing/building_the_docs.rst/0 | {
"file_path": "ivy/docs/overview/contributing/building_the_docs.rst",
"repo_id": "ivy",
"token_count": 902
} | 2 |
Devices
=======
.. _`backend setting`: https://github.com/unifyai/ivy/blob/1eb841cdf595e2bb269fce084bd50fb79ce01a69/ivy/backend_handler.py#L204
.. _`infer_device`: https://github.com/unifyai/ivy/blob/1eb841cdf595e2bb269fce084bd50fb79ce01a69/ivy/func_wrapper.py#L286
.. _`ivy.Device`: https://github.com/unifyai/ivy/blob... | ivy/docs/overview/deep_dive/devices.rst/0 | {
"file_path": "ivy/docs/overview/deep_dive/devices.rst",
"repo_id": "ivy",
"token_count": 5589
} | 3 |
Operating Modes
===============
.. _`array_significant_figures`: https://github.com/unifyai/ivy/blob/59cd7b5c4e2ca2fc6fc3c3ff728c3f210d9f740c/ivy/__init__.py#L865
.. _`array_decimal_values`: https://github.com/unifyai/ivy/blob/59cd7b5c4e2ca2fc6fc3c3ff728c3f210d9f740c/ivy/__init__.py#L904
.. _`warning_level`: https://g... | ivy/docs/overview/deep_dive/operating_modes.rst/0 | {
"file_path": "ivy/docs/overview/deep_dive/operating_modes.rst",
"repo_id": "ivy",
"token_count": 1964
} | 4 |
Why Unify?
==========
“What is the point of unifying all ML frameworks?” you may ask.
You may be perfectly happy with the framework you currently use, and that’s great! We live in a time where great ML tools are in abundance, and that’s a wonderful thing!
Ivy just makes a wonderful thing **even better**…
We’ll give... | ivy/docs/overview/motivation/why_unify.rst/0 | {
"file_path": "ivy/docs/overview/motivation/why_unify.rst",
"repo_id": "ivy",
"token_count": 1838
} | 5 |
.. _`RWorks Wrapper Frameworks`:
Wrapper Frameworks
==================
.. _`EagerPy`: https://eagerpy.jonasrauber.de/
.. _`PyTorch`: https://pytorch.org/
.. _`TensorFlow`: https://www.tensorflow.org/
.. _`JAX`: https://jax.readthedocs.io/
.. _`NumPy`: https://numpy.org/
.. _`Keras`: https://keras.io/
.. _`Microsoft C... | ivy/docs/overview/related_work/wrapper_frameworks.rst/0 | {
"file_path": "ivy/docs/overview/related_work/wrapper_frameworks.rst",
"repo_id": "ivy",
"token_count": 1609
} | 6 |
# global
import abc
from typing import Tuple, Optional, List, Union
# local
import ivy
Finfo = None
Iinfo = None
class _ArrayWithDataTypes(abc.ABC):
def astype(
self: ivy.Array,
dtype: ivy.Dtype,
/,
*,
copy: bool = True,
out: Optional[ivy.Array] = None,
) -> i... | ivy/ivy/data_classes/array/data_type.py/0 | {
"file_path": "ivy/ivy/data_classes/array/data_type.py",
"repo_id": "ivy",
"token_count": 4581
} | 7 |
# global
import abc
from typing import (
Optional,
Union,
Sequence,
Tuple,
List,
Iterable,
Callable,
Literal,
Any,
)
from numbers import Number
# local
import ivy
from ivy import handle_view
class _ArrayWithManipulationExperimental(abc.ABC):
@handle_view
def moveaxis(
... | ivy/ivy/data_classes/array/experimental/manipulation.py/0 | {
"file_path": "ivy/ivy/data_classes/array/experimental/manipulation.py",
"repo_id": "ivy",
"token_count": 23636
} | 8 |
# global
import abc
from typing import Optional, Union
# local
import ivy
class _ArrayWithRandom(abc.ABC):
def random_uniform(
self: ivy.Array,
/,
*,
high: Union[float, ivy.Array, ivy.NativeArray] = 1.0,
shape: Optional[Union[ivy.Array, ivy.Shape, ivy.NativeShape]] = None,... | ivy/ivy/data_classes/array/random.py/0 | {
"file_path": "ivy/ivy/data_classes/array/random.py",
"repo_id": "ivy",
"token_count": 6435
} | 9 |
from .activations import _ContainerWithActivationExperimental
from .conversions import _ContainerWithConversionExperimental
from .creation import _ContainerWithCreationExperimental
from .data_type import _ContainerWithData_typeExperimental
from .device import _ContainerWithDeviceExperimental
from .elementwise import _C... | ivy/ivy/data_classes/container/experimental/__init__.py/0 | {
"file_path": "ivy/ivy/data_classes/container/experimental/__init__.py",
"repo_id": "ivy",
"token_count": 259
} | 10 |
# global
from typing import Optional, Union, List, Dict, Tuple
# local
import ivy
from ivy.data_classes.container.base import ContainerBase
class _ContainerWithSearchingExperimental(ContainerBase):
@staticmethod
def static_unravel_index(
indices: ivy.Container,
shape: Union[Tuple[int], ivy.Co... | ivy/ivy/data_classes/container/experimental/searching.py/0 | {
"file_path": "ivy/ivy/data_classes/container/experimental/searching.py",
"repo_id": "ivy",
"token_count": 1491
} | 11 |
# global
from typing import Optional, List, Union, Dict, Literal
# local
from ivy.data_classes.container.base import ContainerBase
import ivy
# ToDo: implement all methods here as public instance methods
# noinspection PyMissingConstructor
class _ContainerWithSorting(ContainerBase):
@staticmethod
def _stati... | ivy/ivy/data_classes/container/sorting.py/0 | {
"file_path": "ivy/ivy/data_classes/container/sorting.py",
"repo_id": "ivy",
"token_count": 8973
} | 12 |
[package]
name = "xlar"
version = "0.1.0"
edition = "2021"
[lib]
name = "xlar"
crate-type = ["cdylib"]
[dependencies]
thiserror = "1"
libc = "0.2"
num-traits = "0.2"
num-derive = "0.3"
zip = "0.6.4"
pyo3 = { version = "0.19.1", features = ["extension-module"] }
ndarray = "0.15.6"
numpy = "0.19.0"
half = "2.3.1"
[bui... | ivy/ivy/engines/XLA/rust_api/Cargo.toml/0 | {
"file_path": "ivy/ivy/engines/XLA/rust_api/Cargo.toml",
"repo_id": "ivy",
"token_count": 261
} | 13 |
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#ifdef __cplusplus
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wuninitialized"
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#pragma GCC diagnostic ignored "-Winvalid-offsetof"
#pragma GCC diagnostic ignored "-Wreturn-type"
#incl... | ivy/ivy/engines/XLA/rust_api/xla_rs/xla_rs.h/0 | {
"file_path": "ivy/ivy/engines/XLA/rust_api/xla_rs/xla_rs.h",
"repo_id": "ivy",
"token_count": 7623
} | 14 |
# global
from typing import Optional, Tuple
import math
import jax
import jax.numpy as jnp
import jaxlib.xla_extension
# local
from ivy.functional.backends.jax import JaxArray
import ivy
# Array API Standard #
# ------------------ #
def vorbis_window(
window_length: JaxArray,
*,
dtype: jnp.dtype = jnp.f... | ivy/ivy/functional/backends/jax/experimental/creation.py/0 | {
"file_path": "ivy/ivy/functional/backends/jax/experimental/creation.py",
"repo_id": "ivy",
"token_count": 2518
} | 15 |
import jax.numpy as jnp
from typing import Optional, Union, Tuple, Sequence
from ivy.functional.backends.jax import JaxArray
import jax.lax as jlax
import ivy
from ivy.func_wrapper import with_unsupported_dtypes
from . import backend_version
from ..statistical import _infer_dtype
@with_unsupported_dtypes(
{"0.4.... | ivy/ivy/functional/backends/jax/experimental/statistical.py/0 | {
"file_path": "ivy/ivy/functional/backends/jax/experimental/statistical.py",
"repo_id": "ivy",
"token_count": 6665
} | 16 |
"""MXNet activation functions.
Collection of MXNet activation functions, wrapped to fit Ivy syntax and
signature.
"""
import mxnet as mx
import numpy as np
from ivy.utils.exceptions import IvyNotImplementedException
from typing import Optional, Union
def gelu(
x: None,
/,
*,
approximate: bool = Fal... | ivy/ivy/functional/backends/mxnet/activations.py/0 | {
"file_path": "ivy/ivy/functional/backends/mxnet/activations.py",
"repo_id": "ivy",
"token_count": 980
} | 17 |
from typing import Union, Optional, Sequence, Tuple, List
from numbers import Number
import mxnet as mx
from ivy.utils.exceptions import IvyNotImplementedException
def moveaxis(
a: Union[(None, mx.ndarray.NDArray)],
source: Union[(int, Sequence[int])],
destination: Union[(int, Sequence[int])],
/,
... | ivy/ivy/functional/backends/mxnet/experimental/manipulation.py/0 | {
"file_path": "ivy/ivy/functional/backends/mxnet/experimental/manipulation.py",
"repo_id": "ivy",
"token_count": 2312
} | 18 |
import mxnet as mx
from numbers import Number
from typing import Optional, Union, Tuple
import numpy as np
import ivy
from ivy.utils.exceptions import IvyNotImplementedException
def argmax(
x: Union[(None, mx.ndarray.NDArray)],
/,
*,
axis: Optional[int] = None,
keepdims: bool = False,
dtype: ... | ivy/ivy/functional/backends/mxnet/searching.py/0 | {
"file_path": "ivy/ivy/functional/backends/mxnet/searching.py",
"repo_id": "ivy",
"token_count": 727
} | 19 |
from typing import Optional, Union, Tuple, Sequence
import numpy as np
import math
import ivy # noqa
from ivy.func_wrapper import with_unsupported_dtypes
from . import backend_version
from ..statistical import _infer_dtype
from copy import deepcopy
@with_unsupported_dtypes(
{"1.26.3 and below": ("bfloat16",)},
... | ivy/ivy/functional/backends/numpy/experimental/statistical.py/0 | {
"file_path": "ivy/ivy/functional/backends/numpy/experimental/statistical.py",
"repo_id": "ivy",
"token_count": 8322
} | 20 |
# global
import sys
import paddle as paddle
# local
import ivy
from ivy.func_wrapper import _dtype_from_version
backend_version = {"version": paddle.version.full_version}
# noinspection PyUnresolvedReferences
if not ivy.is_local():
_module_in_memory = sys.modules[__name__]
else:
_module_in_memory = sys.modul... | ivy/ivy/functional/backends/paddle/__init__.py/0 | {
"file_path": "ivy/ivy/functional/backends/paddle/__init__.py",
"repo_id": "ivy",
"token_count": 3374
} | 21 |
# global
from typing import Callable
import paddle
# local
import ivy
from ivy.func_wrapper import inputs_to_native_arrays
from ivy.functional.ivy.gradients import (
_flatten_containers,
_rebuild_flattened_containers,
)
from ivy.utils.exceptions import IvyNotImplementedException
def bind_custom_gradient_func... | ivy/ivy/functional/backends/paddle/experimental/gradients.py/0 | {
"file_path": "ivy/ivy/functional/backends/paddle/experimental/gradients.py",
"repo_id": "ivy",
"token_count": 1146
} | 22 |
# global
import paddle
from typing import Union, Optional, Tuple, Literal, List, NamedTuple, Sequence
from collections import namedtuple
# local
import ivy
from ivy import inf
from ivy.utils.exceptions import IvyNotImplementedException
import ivy.functional.backends.paddle as paddle_backend
from . import backend_vers... | ivy/ivy/functional/backends/paddle/linear_algebra.py/0 | {
"file_path": "ivy/ivy/functional/backends/paddle/linear_algebra.py",
"repo_id": "ivy",
"token_count": 9390
} | 23 |
# global
from typing import Union, Optional
import tensorflow as tf
# local
import ivy
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
from ivy import promote_types_of_inputs
from . import backend_version
def abs(
x: Union[float, tf.Tensor, tf.Variable],
/,
*,
out: Optiona... | ivy/ivy/functional/backends/tensorflow/elementwise.py/0 | {
"file_path": "ivy/ivy/functional/backends/tensorflow/elementwise.py",
"repo_id": "ivy",
"token_count": 13007
} | 24 |
# global
from typing import Optional, Tuple, Union
import math
import torch
# local
import ivy
from ivy.func_wrapper import (
with_unsupported_dtypes,
with_unsupported_device_and_dtypes,
)
from .. import backend_version
# noinspection PyProtectedMember
# Array API Standard #
# -------------------#
@with_... | ivy/ivy/functional/backends/torch/experimental/creation.py/0 | {
"file_path": "ivy/ivy/functional/backends/torch/experimental/creation.py",
"repo_id": "ivy",
"token_count": 3446
} | 25 |
# global
from typing import Optional, Union, Tuple, Sequence
import torch
# local
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
from . import backend_version
import ivy
from ..statistical import _infer_dtype
from copy import deepcopy
@with_unsupported_dtypes(
{
"2.2 and belo... | ivy/ivy/functional/backends/torch/experimental/statistical.py/0 | {
"file_path": "ivy/ivy/functional/backends/torch/experimental/statistical.py",
"repo_id": "ivy",
"token_count": 9520
} | 26 |
import torch
import torchvision
from ivy.func_wrapper import to_native_arrays_and_back
@to_native_arrays_and_back
def roi_align(
input, boxes, output_size, spatial_scale=1.0, sampling_ratio=-1, aligned=False
):
ret = torchvision.ops.roi_align(
input, boxes, output_size, spatial_scale, sampling_ratio, ... | ivy/ivy/functional/backends/torch/sub_backends/torchvision/layers.py/0 | {
"file_path": "ivy/ivy/functional/backends/torch/sub_backends/torchvision/layers.py",
"repo_id": "ivy",
"token_count": 619
} | 27 |
from . import control_flow_operators
from .control_flow_operators import *
from . import custom_gradient_operators
from .custom_gradient_operators import *
from . import linalg
from . import operators
from .operators import *
from . import parallel_operators
from .parallel_operators import *
| ivy/ivy/functional/frontends/jax/lax/__init__.py/0 | {
"file_path": "ivy/ivy/functional/frontends/jax/lax/__init__.py",
"repo_id": "ivy",
"token_count": 79
} | 28 |
# local
import ivy
from ivy.functional.frontends.jax.func_wrapper import (
to_ivy_arrays_and_back,
)
from ivy.func_wrapper import with_unsupported_dtypes
from ivy.functional.frontends.jax.numpy import promote_types_of_jax_inputs
from ivy.functional.frontends.numpy.manipulation_routines import trim_zeros
from ivy.ut... | ivy/ivy/functional/frontends/jax/numpy/mathematical_functions.py/0 | {
"file_path": "ivy/ivy/functional/frontends/jax/numpy/mathematical_functions.py",
"repo_id": "ivy",
"token_count": 11417
} | 29 |
import ivy
from ivy.utils.exceptions import handle_exceptions
from numbers import Number
from typing import Union, Tuple, Iterable
# Constructing dtypes are required as ivy.<dtype>
# will change dynamically on the backend and may not be available
_int8 = ivy.IntDtype("int8")
_int16 = ivy.IntDtype("int16")
_int32 = iv... | ivy/ivy/functional/frontends/mxnet/numpy/__init__.py/0 | {
"file_path": "ivy/ivy/functional/frontends/mxnet/numpy/__init__.py",
"repo_id": "ivy",
"token_count": 2499
} | 30 |
from . import indexing_like_operations
from .indexing_like_operations import *
| ivy/ivy/functional/frontends/numpy/indexing_routines/lib/stride_tricks/__init__.py/0 | {
"file_path": "ivy/ivy/functional/frontends/numpy/indexing_routines/lib/stride_tricks/__init__.py",
"repo_id": "ivy",
"token_count": 23
} | 31 |
# local
import ivy
from ivy.functional.frontends.numpy.func_wrapper import to_ivy_arrays_and_back
@to_ivy_arrays_and_back
def rollaxis(a, axis, start=0):
n = len(ivy.shape(a))
if axis < -n or axis >= n:
raise ValueError(f"axis {axis} is out of bounds for array of {n} dimensions")
if axis < 0:
... | ivy/ivy/functional/frontends/numpy/manipulation_routines/transpose_like_operations.py/0 | {
"file_path": "ivy/ivy/functional/frontends/numpy/manipulation_routines/transpose_like_operations.py",
"repo_id": "ivy",
"token_count": 538
} | 32 |
from . import ndarray
from .ndarray import ndarray
| ivy/ivy/functional/frontends/numpy/ndarray/__init__.py/0 | {
"file_path": "ivy/ivy/functional/frontends/numpy/ndarray/__init__.py",
"repo_id": "ivy",
"token_count": 16
} | 33 |
# global
import ivy
from ivy.functional.frontends.numpy.func_wrapper import (
to_ivy_arrays_and_back,
handle_numpy_dtype,
)
@handle_numpy_dtype
@to_ivy_arrays_and_back
def corrcoef(x, y=None, /, *, rowvar=True, bias=None, ddof=None, dtype="float64"):
if (bias is not None) or (ddof is not None):
iv... | ivy/ivy/functional/frontends/numpy/statistics/correlating.py/0 | {
"file_path": "ivy/ivy/functional/frontends/numpy/statistics/correlating.py",
"repo_id": "ivy",
"token_count": 1399
} | 34 |
from typing import Callable
import functools
import ivy
import ivy.functional.frontends.paddle as paddle_frontend
# --- Helpers --- #
# --------------- #
def _from_ivy_array_to_paddle_frontend_tensor(x, nested=False, include_derived=None):
if nested:
return ivy.nested_map(
_from_ivy_array_... | ivy/ivy/functional/frontends/paddle/func_wrapper.py/0 | {
"file_path": "ivy/ivy/functional/frontends/paddle/func_wrapper.py",
"repo_id": "ivy",
"token_count": 1243
} | 35 |
# local
import ivy
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
from ivy.functional.frontends.paddle.func_wrapper import (
to_ivy_arrays_and_back,
)
from ivy.utils.assertions import check_equal
@to_ivy_arrays_and_back
@with_unsupported_dtypes({"2.6.0 and below": ("float16", "bfloat... | ivy/ivy/functional/frontends/paddle/nn/functional/vision.py/0 | {
"file_path": "ivy/ivy/functional/frontends/paddle/nn/functional/vision.py",
"repo_id": "ivy",
"token_count": 3991
} | 36 |
import ivy
from ivy.func_wrapper import (
with_supported_dtypes,
with_unsupported_device_and_dtypes,
)
from ..tensor.tensor import Tensor
from ivy.functional.frontends.paddle.func_wrapper import (
to_ivy_arrays_and_back,
)
# --- Helpers --- #
# --------------- #
def _blend_images(img1, img2, ratio):
... | ivy/ivy/functional/frontends/paddle/vision/transforms.py/0 | {
"file_path": "ivy/ivy/functional/frontends/paddle/vision/transforms.py",
"repo_id": "ivy",
"token_count": 3155
} | 37 |
import ivy
FEATURE_THRESHOLD = 1e-7
class Splitter:
def __init__(
self,
criterion,
max_features,
min_samples_leaf,
min_weight_leaf,
random_state,
*args,
):
self.criterion = criterion
self.n_samples = 0
self.n_features = 0
... | ivy/ivy/functional/frontends/sklearn/tree/_splitter.py/0 | {
"file_path": "ivy/ivy/functional/frontends/sklearn/tree/_splitter.py",
"repo_id": "ivy",
"token_count": 8436
} | 38 |
from . import activations
from . import backend
from . import layers
from . import metrics
from . import regularizers
| ivy/ivy/functional/frontends/tensorflow/keras/__init__.py/0 | {
"file_path": "ivy/ivy/functional/frontends/tensorflow/keras/__init__.py",
"repo_id": "ivy",
"token_count": 27
} | 39 |
import ivy
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.functional.frontends.torch import promote_types_of_torch_inputs
import ivy.functional.frontends.torch as torch_frontend
erfinv = torch_frontend... | ivy/ivy/functional/frontends/torch/miscellaneous_ops.py/0 | {
"file_path": "ivy/ivy/functional/frontends/torch/miscellaneous_ops.py",
"repo_id": "ivy",
"token_count": 9421
} | 40 |
import ivy
from ivy.functional.frontends.torch.tensor import Tensor
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.ivy.gradients import _variable, _is_variable, _variable_data
class Parameter(Tensor):
def __init__(self, data=None, device=None, requires_grad=True):
if data is N... | ivy/ivy/functional/frontends/torch/nn/parameter.py/0 | {
"file_path": "ivy/ivy/functional/frontends/torch/nn/parameter.py",
"repo_id": "ivy",
"token_count": 520
} | 41 |
from . import coordinate_common
from .coordinate_common import *
from . import updater_coordinate
from .updater_coordinate import *
| ivy/ivy/functional/frontends/xgboost/linear/__init__.py/0 | {
"file_path": "ivy/ivy/functional/frontends/xgboost/linear/__init__.py",
"repo_id": "ivy",
"token_count": 36
} | 42 |
# global
from typing import Union, Optional, Callable, Literal
# local
import ivy
from ivy.utils.backend import current_backend
from ivy.utils.exceptions import handle_exceptions
from ivy.func_wrapper import (
handle_array_function,
handle_nestable,
to_native_arrays_and_back,
handle_array_like_without_... | ivy/ivy/functional/ivy/experimental/activations.py/0 | {
"file_path": "ivy/ivy/functional/ivy/experimental/activations.py",
"repo_id": "ivy",
"token_count": 12306
} | 43 |
from typing import Optional, Union, Tuple
import ivy
from ivy.func_wrapper import (
handle_out_argument,
to_native_arrays_and_back,
handle_nestable,
handle_device,
handle_backend_invalid,
)
from ivy.utils.exceptions import handle_exceptions
@handle_exceptions
@handle_backend_invalid
@handle_nestab... | ivy/ivy/functional/ivy/experimental/searching.py/0 | {
"file_path": "ivy/ivy/functional/ivy/experimental/searching.py",
"repo_id": "ivy",
"token_count": 471
} | 44 |
# global
from numbers import Number
from typing import Union, Optional, Tuple
# local
import ivy
from ivy.utils.backend import current_backend
from ivy.utils.exceptions import handle_exceptions
from ivy.func_wrapper import (
handle_array_function,
to_native_arrays_and_back,
handle_out_argument,
handle_... | ivy/ivy/functional/ivy/searching.py/0 | {
"file_path": "ivy/ivy/functional/ivy/searching.py",
"repo_id": "ivy",
"token_count": 6701
} | 45 |
from . import backend
from . import dynamic_import
from .dynamic_import import *
from .binaries import *
| ivy/ivy/utils/__init__.py/0 | {
"file_path": "ivy/ivy/utils/__init__.py",
"repo_id": "ivy",
"token_count": 28
} | 46 |
# TODO should this still be here?
import termcolor
level = 0
def cprint(message, color="green"):
print(termcolor.colored(message, color))
| ivy/ivy/utils/verbosity.py/0 | {
"file_path": "ivy/ivy/utils/verbosity.py",
"repo_id": "ivy",
"token_count": 47
} | 47 |
"""A state holder for testing, this is only intended to hold and store testing
data to be used by the test helpers to prune unsupported data.
Should not be used inside any of the test functions.
"""
from dataclasses import dataclass
from .pipeline_helper import get_frontend_config
# needed for multiversion
available... | ivy/ivy_tests/test_ivy/helpers/globals.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/helpers/globals.py",
"repo_id": "ivy",
"token_count": 1760
} | 48 |
# local
import ivy
import ivy_tests.test_ivy.helpers as helpers
from ivy_tests.test_ivy.helpers import handle_frontend_test, BackendHandler
from ivy.functional.frontends.jax import vmap
from hypothesis import strategies as st
import jax
# --- Helpers --- #
# --------------- #
def _fn1(x, y):
return ivy.matmul(x... | ivy/ivy_tests/test_ivy/test_frontends/test_jax/test_general_functions.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_frontends/test_jax/test_general_functions.py",
"repo_id": "ivy",
"token_count": 2139
} | 49 |
# global
from hypothesis import strategies as st, assume
import numpy as np
import hypothesis.extra.numpy as nph
# local
import ivy
import ivy_tests.test_ivy.helpers as helpers
from ivy_tests.test_ivy.helpers import handle_frontend_test
import ivy_tests.test_ivy.test_frontends.test_numpy.helpers as np_frontend_helpers... | ivy/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_manipulations.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_manipulations.py",
"repo_id": "ivy",
"token_count": 23436
} | 50 |
# global
from hypothesis import strategies as st
import numpy as np
# local
import ivy
from ivy.functional.frontends.numpy import broadcast
import ivy_tests.test_ivy.helpers as helpers
from ivy_tests.test_ivy.helpers import handle_frontend_test
# --- Helpers --- #
# --------------- #
@st.composite
def _broadcastab... | ivy/ivy_tests/test_ivy/test_frontends/test_numpy/test_broadcast/test_methods.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_frontends/test_numpy/test_broadcast/test_methods.py",
"repo_id": "ivy",
"token_count": 1200
} | 51 |
# global
import numpy as np
from hypothesis import strategies as st
from numpy import triu, tril
# local
import ivy_tests.test_ivy.helpers as helpers
from ivy_tests.test_ivy.helpers import handle_frontend_test
# --- Helpers --- #
# --------------- #
# unravel_index
@st.composite
def max_value_as_shape_prod(draw):
... | ivy/ivy_tests/test_ivy/test_frontends/test_numpy/test_indexing_routines/test_generating_index_arrays.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_frontends/test_numpy/test_indexing_routines/test_generating_index_arrays.py",
"repo_id": "ivy",
"token_count": 2529
} | 52 |
# local
import ivy_tests.test_ivy.test_frontends.test_numpy.helpers as np_frontend_helpers
import ivy_tests.test_ivy.helpers as helpers
from ivy_tests.test_ivy.helpers import handle_frontend_test
# logical_and
@handle_frontend_test(
fn_tree="numpy.logical_and",
dtypes_values_casting=np_frontend_helpers.dtypes... | ivy/ivy_tests/test_ivy/test_frontends/test_numpy/test_logic/test_logical_operations.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_frontends/test_numpy/test_logic/test_logical_operations.py",
"repo_id": "ivy",
"token_count": 2664
} | 53 |
# global
from hypothesis import strategies as st
# local
import ivy_tests.test_ivy.helpers as helpers
from ivy_tests.test_ivy.helpers import handle_frontend_test
# --- Helpers --- #
# --------------- #
@st.composite
def _pad_helper(draw):
mode = draw(
st.sampled_from(
[
"con... | ivy/ivy_tests/test_ivy/test_frontends/test_numpy/test_manipulation_routines/test_padding_arrays.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_frontends/test_numpy/test_manipulation_routines/test_padding_arrays.py",
"repo_id": "ivy",
"token_count": 1523
} | 54 |
# global
import numpy as np
from hypothesis import strategies as st, assume
# local
import ivy_tests.test_ivy.helpers as helpers
import ivy_tests.test_ivy.test_frontends.test_numpy.helpers as np_frontend_helpers
from ivy_tests.test_ivy.helpers import handle_frontend_test
# --- Helpers --- #
# --------------- #
# t... | ivy/ivy_tests/test_ivy/test_frontends/test_numpy/test_mathematical_functions/test_sums_products_differences.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_frontends/test_numpy/test_mathematical_functions/test_sums_products_differences.py",
"repo_id": "ivy",
"token_count": 6115
} | 55 |
# global
from hypothesis import strategies as st
# local
import ivy_tests.test_ivy.helpers as helpers
from ivy_tests.test_ivy.helpers import handle_frontend_test
import ivy_tests.test_ivy.test_frontends.test_numpy.helpers as np_helpers
# corrcoef
@handle_frontend_test(
fn_tree="numpy.corrcoef",
dtype_and_x=h... | ivy/ivy_tests/test_ivy/test_frontends/test_numpy/test_statistics/test_correlating.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_frontends/test_numpy/test_statistics/test_correlating.py",
"repo_id": "ivy",
"token_count": 1125
} | 56 |
# global
from hypothesis import strategies as st
import math
# local
import ivy_tests.test_ivy.helpers as helpers
from ivy_tests.test_ivy.helpers import handle_frontend_test
from ivy_tests.test_ivy.test_functional.test_experimental.test_core.test_manipulation import ( # noqa
_get_dtype_values_k_axes_for_rot90,
)
... | ivy/ivy_tests/test_ivy/test_frontends/test_paddle/test_manipulation.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_frontends/test_paddle/test_manipulation.py",
"repo_id": "ivy",
"token_count": 11371
} | 57 |
# global
from hypothesis import strategies as st
# local
import ivy_tests.test_ivy.helpers as helpers
from ivy_tests.test_ivy.helpers import handle_frontend_test
from ivy_tests.test_ivy.test_functional.test_core.test_statistical import (
_statistical_dtype_values,
)
# mean
@handle_frontend_test(
fn_tree="pad... | ivy/ivy_tests/test_ivy/test_frontends/test_paddle/test_stat.py/0 | {
"file_path": "ivy/ivy_tests/test_ivy/test_frontends/test_paddle/test_stat.py",
"repo_id": "ivy",
"token_count": 2201
} | 58 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.