Learning Path
浏览 PyTorch 相关教程与章节。
AI Agent、机器学习、深度学习、数据分析与 Python 科学计算。
教程
525
PyTorch torch.any 函数 Pytorch torch 参考手册 torch.any 是 PyTorch 中用于判断是否有元素为 True 的函数。 函数定义 torch.any(input, dim, keepdim, out) 使用示例 实例 [mycode4 type='python'] import torch x = torch.tensor([[True, False,..
PyTorch torch.arange 函数 Pytorch torch 参考手册 torch.arange 是 PyTorch 中用于创建等差数列张量的函数。它会创建一个一维张量,包含从起始值到结束值的等差数列。 这在深度学习中常用于创建索引、范围数组或在循环中生成序列。 函数定义 torch.arange(start=0, end, step=1, dtype=None, device=None, requires_g..
PyTorch torch.arccos 函数 Pytorch torch 参考手册 torch.arccos 是 PyTorch 中用于计算逐元素反余弦(arccosine)的函数,与 torch.acos 功能相同。 函数定义 torch.arccos(input, out=None) 使用示例 实例 [mycode4 type='python'] import torch # 创建张量 x..
PyTorch torch.arccosh 函数 Pytorch torch 参考手册 torch.arccosh 是 PyTorch 中用于计算逐元素反双曲余弦(inverse hyperbolic cosine)的函数,与 torch.acosh 功能相同。 函数定义 torch.arccosh(input, out=None) 使用示例 实例 [mycode4 type='python'] ..
PyTorch torch.arcsin 函数 Pytorch torch 参考手册 torch.arcsin 是 PyTorch 中用于计算逐元素反正弦(arcsine)的函数,与 torch.asin 功能相同。 函数定义 torch.arcsin(input, out=None) 使用示例 实例 [mycode4 type='python'] import torch # 创建张量 x =..
PyTorch torch.arcsinh 函数 Pytorch torch 参考手册 torch.arcsinh 是 PyTorch 中用于计算逐元素反双曲正弦(inverse hyperbolic sine)的函数,与 torch.asinh 功能相同。 函数定义 torch.arcsinh(input, out=None) 使用示例 实例 [mycode4 type='python'] im..
PyTorch torch.arctan 函数 Pytorch torch 参考手册 torch.arctan 是 PyTorch 中用于计算逐元素反正切(arctangent)的函数,与 torch.atan 功能相同。 函数定义 torch.arctan(input, out=None) 使用示例 实例 [mycode4 type='python'] import torch # 创建张量 ..
PyTorch torch.arctan2 函数 Pytorch torch 参考手册 torch.arctan2 是 PyTorch 中用于计算逐元素二维反正切(arctangent2)的函数,与 torch.atan2 功能相同。 函数定义 torch.arctan2(input, other, out=None) 参数说明 input: 分子张量(y坐标) other: 分母张量(x坐标) out: 输出张量(可选..
PyTorch torch.arctanh 函数 Pytorch torch 参考手册 torch.arctanh 是 PyTorch 中用于计算逐元素反双曲正切(inverse hyperbolic tangent)的函数,与 torch.atanh 功能相同。 函数定义 torch.arctanh(input, out=None) 使用示例 实例 [mycode4 type='python']..
PyTorch torch.are_deterministic_algorithms_enabled 函数 Pytorch torch 参考手册 torch.are_deterministic_algorithms_enabled 是 PyTorch 中用于检查确定性算法是否启用的函数。返回 True 表示启用了确定性算法,这意味着每次运行都会产生相同的结果。 函数定义 torch.are_deterministic_algori..
PyTorch torch.argmax 函数 Pytorch torch 参考手册 torch.argmax 是 PyTorch 中用于返回沿维度最大值的索引的函数。 函数定义 torch.argmax(input, dim, keepdim) 使用示例 实例 [mycode4 type='python'] import torch x = torch.tensor([[1, 3, 2], [..
PyTorch torch.argmin 函数 Pytorch torch 参考手册 torch.argmin 是 PyTorch 中用于返回沿维度最小值的索引的函数。 函数定义 torch.argmin(input, dim, keepdim) 使用示例 实例 [mycode4 type='python'] import torch x = torch.tensor([[1, 3, 2], [..
PyTorch torch.argsort 函数 Pytorch torch 参考手册 torch.argsort 是 PyTorch 中用于返回排序后索引的函数。它返回将张量排序后各元素原位置的索引。 函数定义 torch.argsort(input, dim=-1, descending=False, stable=True) 使用示例 实例 [mycode4 type='python'] i..
PyTorch torch.argwhere 函数 Pytorch torch 参考手册 torch.argwhere 是 PyTorch 中用于返回满足条件的元素索引的函数。它返回输入张量中值为 True(非零)的元素索引。 函数定义 torch.argwhere(input) 参数: input (Tensor): 输入张量。 返回值: torch.Tensor: 返回一个二维张量,每行是一个满足条件的元素索引..
PyTorch torch.as_tensor 函数 Pytorch torch 参考手册 torch.as_tensor 是 PyTorch 中用于将数据转换为张量的函数。与 torch.tensor 不同,它尽可能共享数据内存。 函数定义 torch.as_tensor(data, dtype=None, device=None) 使用示例 实例 [mycode4 type='python']..
PyTorch torch.asarray 函数 Pytorch torch 参考手册 torch.asarray 是 PyTorch 中用于将数据转换为张量数组的函数。 函数定义 torch.asarray(data, dtype, device) 使用示例 实例 [mycode4 type='python'] import torch # 从列表转换 x = torch.asarray([1..
PyTorch torch.asin 函数 Pytorch torch 参考手册 torch.asin 是 PyTorch 中用于计算逐元素反正弦(arcsine)的函数。 函数定义 torch.asin(input, out=None) 使用示例 实例 [mycode4 type='python'] import torch # 创建张量 x = torch.tensor([-1.0, -0...
PyTorch torch.asinh 函数 Pytorch torch 参考手册 torch.asinh 是 PyTorch 中用于计算逐元素反双曲正弦(inverse hyperbolic sine)的函数。 函数定义 torch.asinh(input, out=None) 使用示例 实例 [mycode4 type='python'] import torch # 创建张量 x = to..
PyTorch torch.atan 函数 Pytorch torch 参考手册 torch.atan 是 PyTorch 中用于计算逐元素反正切(arctangent)的函数。 函数定义 torch.atan(input, out=None) 使用示例 实例 [mycode4 type='python'] import torch # 创建张量 x = torch.tensor([-1.0, ..
PyTorch torch.atan2 函数 Pytorch torch 参考手册 torch.atan2 是 PyTorch 中用于计算逐元素二维反正切(arctangent2)的函数。它根据两个坐标值 (y, x) 计算角度,返回值的单位为弧度,范围在 [-pi, pi] 之间。 函数定义 torch.atan2(input, other, out=None) 参数说明 input: 分子张量(y坐标) other:..
PyTorch torch.atanh 函数 Pytorch torch 参考手册 torch.atanh 是 PyTorch 中用于计算逐元素反双曲正切(inverse hyperbolic tangent)的函数。 函数定义 torch.atanh(input, out=None) 使用示例 实例 [mycode4 type='python'] import torch # 创建张量(值必须..
PyTorch torch.atleast_1d 函数 Pytorch torch 参考手册 torch.atleast_1d 是 PyTorch 中用于将输入张量转换为至少 1 维的函数。如果输入已经是至少 1 维的,则返回原始张量的视图;否则会添加一个新的维度。 函数定义 torch.atleast_1d(*tensors) 使用示例 实例 [mycode4 type='python'] import..
PyTorch torch.atleast_2d 函数 Pytorch torch 参考手册 torch.atleast_2d 是 PyTorch 中用于将输入张量转换为至少 2 维的函数。如果输入维度少于 2 维,会自动添加维度使其变为 2 维。 函数定义 torch.atleast_2d(*tensors) 使用示例 实例 [mycode4 type='python'] import torch #..
PyTorch torch.atleast_3d 函数 Pytorch torch 参考手册 torch.atleast_3d 是 PyTorch 中用于将输入张量转换为至少 3 维的函数。如果输入维度少于 3 维,会自动添加维度使其变为 3 维。 函数定义 torch.atleast_3d(*tensors) 使用示例 实例 [mycode4 type='python'] import torch #..