id int64 0 190k | prompt stringlengths 21 13.4M | docstring stringlengths 1 12k ⌀ |
|---|---|---|
147,789 | 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
def threshold(input, threshold, value, inplace=False):
return ivy.where(ivy.greater(input, threshold), input, value) | null |
147,790 | 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
def threshold_(input, threshold, value):
return threshold(input, threshold, value, inplace=True) | null |
147,791 | import ivy
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_supported_dtypes
def embedding(
input,
weight,
padding_idx=None,
max_norm=None,
norm_type=2.0,
scale_grad_by_freq=False,
sparse=False,
):
# TODO: add support for t... | null |
147,792 | import ivy
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_supported_dtypes
def one_hot(tensor, num_classes=-1):
return ivy.astype(ivy.one_hot(tensor, num_classes), tensor.dtype) | null |
147,793 | import ivy
from ivy.func_wrapper import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def batch_norm(
input,
running_mean,
running_var,
weight=None,
bias=None,
training=False,
momentum=0.1,
eps=1e-5,
):
normalized, mean, var =... | null |
147,794 | import ivy
from ivy.func_wrapper import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def group_norm(input, num_groups, weight=None, bias=None, eps=1e-05):
return ivy.group_norm(
input, num_groups, scale=weight, offset=bias, data_format="NCS", eps=ep... | null |
147,795 | import ivy
from ivy.func_wrapper import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def instance_norm(
input,
running_mean,
running_var,
weight=None,
bias=None,
use_input_stats=False,
momentum=0.1,
eps=1e-5,
):
normalized, m... | null |
147,796 | import ivy
from ivy.func_wrapper import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def layer_norm(input, normalized_shape, weight=None, bias=None, eps=1e-05):
shape = ivy.shape(input)
if isinstance(normalized_shape, int) and normalized_shape == shape[... | null |
147,797 | import ivy
from ivy.func_wrapper import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def linear(input, weight, bias=None):
return ivy.linear(input, weight, bias=bias) | null |
147,798 | import math
import ivy
from ivy.func_wrapper import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def _conv(input, weight, bias=None, stride=1, padding=0, dilation=1, groups=1):
dims = len(input.shape) - 2
if isinstance(padding, str):
padding = pa... | null |
147,799 | import math
import ivy
from ivy.func_wrapper import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def _conv(input, weight, bias=None, stride=1, padding=0, dilation=1, groups=1):
dims = len(input.shape) - 2
if isinstance(padding, str):
padding = pa... | null |
147,800 | import math
import ivy
from ivy.func_wrapper import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def _conv(input, weight, bias=None, stride=1, padding=0, dilation=1, groups=1):
dims = len(input.shape) - 2
if isinstance(padding, str):
padding = pa... | null |
147,801 | import math
import ivy
from ivy.func_wrapper import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def _conv_transpose(
input,
weight,
bias=None,
stride=1,
padding=0,
output_padding=0,
groups=1,
dilation=1,
):
dims = len(input.s... | null |
147,802 | import math
import ivy
from ivy.func_wrapper import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def _conv_transpose(
input,
weight,
bias=None,
stride=1,
padding=0,
output_padding=0,
groups=1,
dilation=1,
):
dims = len(input.s... | null |
147,803 | import math
import ivy
from ivy.func_wrapper import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def _conv_transpose(
input,
weight,
bias=None,
stride=1,
padding=0,
output_padding=0,
groups=1,
dilation=1,
):
dims = len(input.s... | null |
147,804 | import math
import ivy
from ivy.func_wrapper import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def fold(input, output_size, kernel_size, dilation=1, padding=0, stride=1):
orig_ndim = input.ndim
if orig_ndim == 2:
input = ivy.expand_dims(input,... | null |
147,805 | import math
import ivy
from ivy.func_wrapper import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def unfold(input, kernel_size, dilation=1, padding=0, stride=1):
# TODO: refactor this function to use ivy.sliding_window, but ensure that the
# function is... | null |
147,806 | import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
def _get_reduction_method(reduction, to_reduce):
if reduction == "none":
ret = to_redu... | null |
147,807 | import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
def _get_reduction_string(size_average, reduce):
if size_average is None:
size_average... | null |
147,808 | import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
def _get_reduction(reduction, size_average=None, reduce=None):
if size_average is not None or ... | null |
147,809 | import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
def _get_reduction(reduction, size_average=None, reduce=None):
def cross_entropy(
input,
... | null |
147,810 | import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
def _get_reduction_func(reduction):
if reduction == "none":
def ret(x):
re... | null |
147,811 | import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
def _get_reduction(reduction, size_average=None, reduce=None):
if size_average is not None or ... | null |
147,812 | import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
def huber_loss(
input,
target,
reduction="mean",
delta=1.0,
):
return ivy.hub... | null |
147,813 | import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
def _get_reduction_string(size_average, reduce):
if size_average is None:
size_average... | null |
147,814 | import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
def _get_reduction_string(size_average, reduce):
if size_average is None:
size_average... | null |
147,815 | import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
def _get_reduction(reduction, size_average=None, reduce=None):
if size_average is not None or ... | null |
147,816 | import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
def _get_reduction(reduction, size_average=None, reduce=None):
if size_average is not None or ... | null |
147,817 | import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
def _get_reduction(reduction, size_average=None, reduce=None):
if size_average is not None or ... | null |
147,818 | import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
def _get_reduction(reduction, size_average=None, reduce=None):
def multilabel_soft_margin_loss(
... | null |
147,819 | import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
def _get_reduction(reduction, size_average=None, reduce=None):
if size_average is not None or ... | null |
147,820 | import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
def _get_reduction(reduction, size_average=None, reduce=None):
def poisson_nll_loss(
input,
... | null |
147,821 | import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
def smooth_l1_loss(
input,
target,
size_average=None,
reduce=None,
reduction=... | null |
147,822 | import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
def soft_margin_loss(
input,
target,
size_average=None,
reduce=None,
reductio... | null |
147,823 | import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
def _get_reduction(reduction, size_average=None, reduce=None):
if size_average is not None or ... | null |
147,824 | import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
def _get_reduction(reduction, size_average=None, reduce=None):
def pairwise_distance(x1, x2, *, p=... | null |
147,825 | from functools import reduce
import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import (
to_ivy_arrays_and_back,
)
def adaptive_avg_pool1d(input, output_size):
return ivy.adaptive_avg_pool1d(input, output_s... | null |
147,826 | from functools import reduce
import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import (
to_ivy_arrays_and_back,
)
def adaptive_avg_pool2d(input, output_size):
return ivy.adaptive_avg_pool2d(input, output_s... | null |
147,827 | from functools import reduce
import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import (
to_ivy_arrays_and_back,
)
def adaptive_max_pool2d(
input,
output_size,
return_indices=False,
):
# ToDo: A... | null |
147,828 | from functools import reduce
import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import (
to_ivy_arrays_and_back,
)
def adaptive_max_pool3d(
input,
output_size,
return_indices=False,
):
return iv... | null |
147,829 | from functools import reduce
import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import (
to_ivy_arrays_and_back,
)
def avg_pool3d(
input,
kernel_size,
stride=None,
padding=0,
ceil_mode=False... | null |
147,830 | from functools import reduce
import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import (
to_ivy_arrays_and_back,
)
def avg_pool1d(
input,
kernel_size,
stride=None,
padding=0,
ceil_mode=False,... | null |
147,831 | from functools import reduce
import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import (
to_ivy_arrays_and_back,
)
def avg_pool2d(
input,
kernel_size,
stride=None,
padding=0,
ceil_mode=False,... | null |
147,832 | from functools import reduce
import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import (
to_ivy_arrays_and_back,
)
def max_pool1d(
input,
kernel_size,
stride=None,
padding=0,
dilation=1,
... | null |
147,833 | from functools import reduce
import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import (
to_ivy_arrays_and_back,
)
def max_pool2d(
input,
kernel_size,
stride=None,
padding=0,
dilation=1,
... | null |
147,834 | from functools import reduce
import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import (
to_ivy_arrays_and_back,
)
def max_pool3d(
input,
kernel_size,
stride=None,
padding=0,
dilation=1,
... | null |
147,835 | import ivy
from ivy.func_wrapper import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def alpha_dropout(input, p=0.5, training=False, inplace=False):
if p == 0.0 or not training or input.shape == () or input.shape == (0,):
return input
neg_satura... | null |
147,836 | import ivy
from ivy.func_wrapper import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def dropout(input, p=0.5, training=True, inplace=False):
return ivy.dropout(input, p, scale=True, training=training) | null |
147,837 | import ivy
from ivy.func_wrapper import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def dropout1d(input, p=0.5, training=True, inplace=False):
if inplace:
return ivy.dropout1d(input, p, training=training, data_format="NCW", out=input)
return iv... | null |
147,838 | import ivy
from ivy.func_wrapper import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def dropout2d(input, p=0.5, training=True, inplace=False):
if input.ndim < 2:
raise ValueError("Feature dropout requires at least 2 dimensions in the input")
r... | null |
147,839 | import ivy
from ivy.func_wrapper import with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def dropout3d(input, p=0.5, training=True, inplace=False):
if inplace:
return ivy.dropout3d(
input, p, training=training, data_format="NDHWC", out=input... | null |
147,840 | import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_unsupported_dtypes
def cosine_similarity(x1, x2, *, dim=1, eps=1e-08):
x1, x2 = torch_frontend.promote_types_of_torch_inputs(x1, x2)
... | null |
147,841 | import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_unsupported_dtypes
def pairwise_distance(x1, x2, *, p=2.0, eps=1e-06, keepdim=False):
x1, x2 = torch_frontend.promote_types_of_torch_in... | null |
147,842 | import ivy
import ivy.functional.frontends.torch as torch_frontend
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
from ivy.func_wrapper import with_unsupported_dtypes
def pdist(input, p=2):
x = ivy.array(
[
abs(input[i] - input[j])
for i in range(len(... | null |
147,843 | import ivy
from ivy.func_wrapper import with_supported_device_and_dtypes, with_supported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def _extract_states(states, batch_sizes):
h = []
for i in range(states.shape[1]):
h.append(states[int(batch_sizes[i] - 1), i])
... | null |
147,844 | import ivy
from ivy.func_wrapper import with_supported_device_and_dtypes, with_supported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def multi_head_attention_forward(
query,
key,
value,
embed_dim_to_check,
num_heads,
in_proj_weight,
in_proj_bias,
... | null |
147,845 | import ivy
from ivy import with_unsupported_dtypes, with_supported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def affine_grid(theta, size, align_corners=False):
if len(size) == 4:
N, C, H, W = size
base_grid = ivy.empty((N, H, W, 3))
if align_corne... | null |
147,846 | import ivy
from ivy import with_unsupported_dtypes, with_supported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def bicubic_interp(x, t, alpha=-0.75):
n, h, w = t.shape
coeffs = []
coeffs.append(ivy.reshape(cubic_conv2(alpha, t + 1), (n, 1, h, w)))
coeffs.append(... | null |
147,847 | import ivy
from ivy import with_unsupported_dtypes, with_supported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def pixel_shuffle(input, upscale_factor):
input_shape = ivy.shape(input)
ivy.utils.assertions.check_equal(
ivy.get_num_dims(input),
4,
... | null |
147,848 | import ivy
from ivy import with_unsupported_dtypes, with_supported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def pixel_unshuffle(input, downscale_factor):
input_shape = ivy.shape(input)
ivy.utils.assertions.check_equal(
ivy.get_num_dims(input),
4,
... | null |
147,849 | import ivy
from ivy import with_unsupported_dtypes, with_supported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def interpolate(
input,
size=None,
scale_factor=None,
mode="nearest",
align_corners=None,
recompute_scale_factor=None,
antialias=False,
):
... | null |
147,850 | import ivy
from ivy import with_unsupported_dtypes, with_supported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def interpolate(
input,
size=None,
scale_factor=None,
mode="nearest",
align_corners=None,
recompute_scale_factor=None,
antialias=False,
):
... | null |
147,851 | import ivy
from ivy import with_unsupported_dtypes, with_supported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def interpolate(
input,
size=None,
scale_factor=None,
mode="nearest",
align_corners=None,
recompute_scale_factor=None,
antialias=False,
):
... | null |
147,852 | import ivy
from ivy.func_wrapper import with_supported_dtypes, with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
import ivy
from ivy.utils.exceptions import handle_exceptions
from ivy.functional.frontends import set_frontend_to_specific_version
if iv... | null |
147,853 | import ivy
from ivy.func_wrapper import with_supported_dtypes, with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
import ivy
from ivy.utils.exceptions import handle_exceptions
from ivy.functional.frontends import set_frontend_to_specific_version
if iv... | null |
147,854 | import ivy
from ivy.func_wrapper import with_supported_dtypes, with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
import ivy
from ivy.utils.exceptions import handle_exceptions
from ivy.functional.frontends import set_frontend_to_specific_version
if iv... | null |
147,855 | import ivy
from ivy.func_wrapper import with_supported_dtypes, with_unsupported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
import ivy
from ivy.utils.exceptions import handle_exceptions
from ivy.functional.frontends import set_frontend_to_specific_version
if iv... | null |
147,856 | import ivy
from ivy.func_wrapper import with_supported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def seed() -> int:
"""Return a 64 bit number used to seed the RNG."""
return int(ivy.randint(-(2**63), 2**63 - 1))
{"2.2 and below": ("uint8",)},
"torch",
import ... | null |
147,857 | import ivy
from ivy.func_wrapper import with_supported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
import ivy
from ivy.utils.exceptions import handle_exceptions
from ivy.functional.frontends import set_frontend_to_specific_version
if ivy.is_local():
module ... | null |
147,858 | import ivy
from ivy.func_wrapper import with_supported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def seed() -> int:
"""Return a 64 bit number used to seed the RNG."""
return int(ivy.randint(-(2**63), 2**63 - 1))
{"2.2 and below": ("uint8",)},
"torch",
import ... | null |
147,859 | import ivy
from ivy.func_wrapper import with_supported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def seed() -> int:
"""Return a 64 bit number used to seed the RNG."""
return int(ivy.randint(-(2**63), 2**63 - 1))
{"2.2 and below": ("uint8",)},
"torch",
import ... | null |
147,860 | import ivy
from ivy.func_wrapper import with_supported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def seed() -> int:
"""Return a 64 bit number used to seed the RNG."""
return int(ivy.randint(-(2**63), 2**63 - 1))
{"2.2 and below": ("uint8",)},
"torch",
import ... | null |
147,861 | import ivy
from ivy.func_wrapper import with_supported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def seed() -> int:
import ivy
from ivy.utils.exceptions import handle_exceptions
from ivy.functional.frontends import set_frontend_to_specific_version
if ivy.is_l... | null |
147,862 | import ivy
from ivy.func_wrapper import with_supported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
import ivy
from ivy.utils.exceptions import handle_exceptions
from ivy.functional.frontends import set_frontend_to_specific_version
if ivy.is_local():
module ... | null |
147,863 | import ivy
from ivy.func_wrapper import with_supported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def randint(
low,
high,
size,
*,
generator=None,
out=None,
dtype=None,
layout=None,
device=None,
requires_grad=False,
):
seed = generat... | null |
147,864 | import ivy
from ivy.func_wrapper import with_supported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def seed() -> int:
"""Return a 64 bit number used to seed the RNG."""
return int(ivy.randint(-(2**63), 2**63 - 1))
{"2.2 and below": ("uint8",)},
"torch",
import ... | null |
147,865 | import ivy
from ivy.func_wrapper import with_supported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
import ivy
from ivy.utils.exceptions import handle_exceptions
from ivy.functional.frontends import set_frontend_to_specific_version
if ivy.is_local():
module ... | null |
147,866 | import ivy
from ivy.func_wrapper import with_supported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def seed() -> int:
"""Return a 64 bit number used to seed the RNG."""
return int(ivy.randint(-(2**63), 2**63 - 1))
{"2.2 and below": ("uint8",)},
"torch",
import ... | null |
147,867 | import ivy
from ivy.func_wrapper import with_supported_dtypes
from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
def seed() -> int:
"""Return a 64 bit number used to seed the RNG."""
return int(ivy.randint(-(2**63), 2**63 - 1))
{"2.2 and below": ("uint8",)},
"torch",
import ... | null |
147,868 | import functools
from typing import Callable
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",
}
The provided code snippet includes necessary dependencies f... | Convert argument names from NumPy style to PyTorch style. |
147,869 | import functools
from typing import Callable
import ivy
import ivy.functional.frontends.torch as torch_frontend
import ivy
from ivy.utils.exceptions import handle_exceptions
from ivy.functional.frontends import set_frontend_to_specific_version
if ivy.is_local():
module = ivy.utils._importlib.import... | Wrap `fn` so it receives `ivy.Shape` instances. Wrap `fn` so that any `torch_frontend.Size` arguments are converted to `ivy.Shape` instances. |
147,870 | 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,
numpy_to_torch_style_args,
)
from collections import namedtuple
import ivy.functional.frontends.torch as torch_frontend
import ivy
from ivy.ut... | null |
147,871 | 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,
numpy_to_torch_style_args,
)
from collections import namedtuple
import ivy.functional.frontends.torch as torch_frontend
def max(*input, dim=Non... | null |
147,872 | 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,
numpy_to_torch_style_args,
)
from collections import namedtuple
import ivy.functional.frontends.torch as torch_frontend
def min(*input, dim=Non... | null |
147,873 | 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,
numpy_to_torch_style_args,
)
from collections import namedtuple
import ivy.functional.frontends.torch as torch_frontend
def max(*input, dim=Non... | null |
147,874 | 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,
numpy_to_torch_style_args,
)
from collections import namedtuple
import ivy.functional.frontends.torch as torch_frontend
import ivy
from ivy.ut... | null |
147,875 | 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,
numpy_to_torch_style_args,
)
from collections import namedtuple
import ivy.functional.frontends.torch as torch_frontend
import ivy
from ivy.ut... | null |
147,876 | 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,
numpy_to_torch_style_args,
)
from collections import namedtuple
import ivy.functional.frontends.torch as torch_frontend
import ivy
from ivy.ut... | null |
147,877 | 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,
numpy_to_torch_style_args,
)
from collections import namedtuple
import ivy.functional.frontends.torch as torch_frontend
def max(*input, dim=Non... | null |
147,878 | 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,
numpy_to_torch_style_args,
)
from collections import namedtuple
import ivy.functional.frontends.torch as torch_frontend
import ivy
from ivy.ut... | null |
147,879 | 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,
numpy_to_torch_style_args,
)
from collections import namedtuple
import ivy.functional.frontends.torch as torch_frontend
import ivy
from ivy.ut... | null |
147,880 | 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,
numpy_to_torch_style_args,
)
from collections import namedtuple
import ivy.functional.frontends.torch as torch_frontend
import ivy
from ivy.ut... | null |
147,881 | 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,
numpy_to_torch_style_args,
)
from collections import namedtuple
import ivy.functional.frontends.torch as torch_frontend
def sum(input, dim=None... | null |
147,882 | 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,
numpy_to_torch_style_args,
)
from collections import namedtuple
import ivy.functional.frontends.torch as torch_frontend
def sum(input, dim=None... | null |
147,883 | 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,
numpy_to_torch_style_args,
)
from collections import namedtuple
import ivy.functional.frontends.torch as torch_frontend
import ivy
from ivy.ut... | null |
147,884 | 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,
numpy_to_torch_style_args,
)
from collections import namedtuple
import ivy.functional.frontends.torch as torch_frontend
import ivy
from ivy.ut... | null |
147,885 | 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,
numpy_to_torch_style_args,
)
from collections import namedtuple
import ivy.functional.frontends.torch as torch_frontend
import ivy
from ivy.ut... | null |
147,886 | 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,
numpy_to_torch_style_args,
)
from collections import namedtuple
import ivy.functional.frontends.torch as torch_frontend
def mean(input, dim=Non... | null |
147,887 | 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,
numpy_to_torch_style_args,
)
from collections import namedtuple
import ivy.functional.frontends.torch as torch_frontend
import ivy
from ivy.ut... | null |
147,888 | 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,
numpy_to_torch_style_args,
)
from collections import namedtuple
import ivy.functional.frontends.torch as torch_frontend
import ivy
from ivy.ut... | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.