DepthTensor 1.6.0__tar.gz → 1.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {depthtensor-1.6.0/src/DepthTensor.egg-info → depthtensor-1.7.0}/PKG-INFO +1 -1
- {depthtensor-1.6.0 → depthtensor-1.7.0}/pyproject.toml +1 -1
- {depthtensor-1.6.0 → depthtensor-1.7.0}/src/DepthTensor/__init__.py +1 -1
- {depthtensor-1.6.0 → depthtensor-1.7.0}/src/DepthTensor/_core/random/generator.py +18 -12
- {depthtensor-1.6.0 → depthtensor-1.7.0/src/DepthTensor.egg-info}/PKG-INFO +1 -1
- {depthtensor-1.6.0 → depthtensor-1.7.0}/LICENSE +0 -0
- {depthtensor-1.6.0 → depthtensor-1.7.0}/README.md +0 -0
- {depthtensor-1.6.0 → depthtensor-1.7.0}/setup.cfg +0 -0
- {depthtensor-1.6.0 → depthtensor-1.7.0}/src/DepthTensor/_core/__init__.py +0 -0
- {depthtensor-1.6.0 → depthtensor-1.7.0}/src/DepthTensor/_core/exceptions.py +0 -0
- {depthtensor-1.6.0 → depthtensor-1.7.0}/src/DepthTensor/_core/ops/__init__.py +0 -0
- {depthtensor-1.6.0 → depthtensor-1.7.0}/src/DepthTensor/_core/ops/comparison.py +0 -0
- {depthtensor-1.6.0 → depthtensor-1.7.0}/src/DepthTensor/_core/ops/creation.py +0 -0
- {depthtensor-1.6.0 → depthtensor-1.7.0}/src/DepthTensor/_core/ops/diff.py +0 -0
- {depthtensor-1.6.0 → depthtensor-1.7.0}/src/DepthTensor/_core/ops/elementwise.py +0 -0
- {depthtensor-1.6.0 → depthtensor-1.7.0}/src/DepthTensor/_core/ops/reduction.py +0 -0
- {depthtensor-1.6.0 → depthtensor-1.7.0}/src/DepthTensor/_core/random/__init__.py +0 -0
- {depthtensor-1.6.0 → depthtensor-1.7.0}/src/DepthTensor/_core/utils.py +0 -0
- {depthtensor-1.6.0 → depthtensor-1.7.0}/src/DepthTensor/autodiff.py +0 -0
- {depthtensor-1.6.0 → depthtensor-1.7.0}/src/DepthTensor/tensor.py +0 -0
- {depthtensor-1.6.0 → depthtensor-1.7.0}/src/DepthTensor/typing.py +0 -0
- {depthtensor-1.6.0 → depthtensor-1.7.0}/src/DepthTensor.egg-info/SOURCES.txt +0 -0
- {depthtensor-1.6.0 → depthtensor-1.7.0}/src/DepthTensor.egg-info/dependency_links.txt +0 -0
- {depthtensor-1.6.0 → depthtensor-1.7.0}/src/DepthTensor.egg-info/requires.txt +0 -0
- {depthtensor-1.6.0 → depthtensor-1.7.0}/src/DepthTensor.egg-info/top_level.txt +0 -0
- {depthtensor-1.6.0 → depthtensor-1.7.0}/src/example/example.py +0 -0
- {depthtensor-1.6.0 → depthtensor-1.7.0}/tests/test_tensor.py +0 -0
|
@@ -28,17 +28,19 @@ except (ImportError, ModuleNotFoundError):
|
|
|
28
28
|
###
|
|
29
29
|
|
|
30
30
|
@overload
|
|
31
|
-
def rand(*, device: DeviceLike = "cpu") -> TensorLike: ...
|
|
31
|
+
def rand(*, device: DeviceLike = "cpu", requires_grad: bool = False) -> TensorLike: ...
|
|
32
32
|
@overload
|
|
33
33
|
def rand(
|
|
34
34
|
*d: int,
|
|
35
35
|
dtype: Optional[DTypeLike] = None,
|
|
36
|
-
device: DeviceLike = "cpu"
|
|
36
|
+
device: DeviceLike = "cpu",
|
|
37
|
+
requires_grad: bool = False
|
|
37
38
|
) -> TensorLike: ...
|
|
38
39
|
def rand(
|
|
39
40
|
*d: int,
|
|
40
41
|
dtype: Optional[DTypeLike] = None,
|
|
41
|
-
device: DeviceLike = "cpu"
|
|
42
|
+
device: DeviceLike = "cpu",
|
|
43
|
+
requires_grad: bool = False
|
|
42
44
|
) -> TensorLike:
|
|
43
45
|
from ...tensor import Tensor
|
|
44
46
|
if device == "cpu":
|
|
@@ -46,20 +48,22 @@ def rand(
|
|
|
46
48
|
else:
|
|
47
49
|
if cp is None: raise CuPyNotFound(CUPY_NOT_FOUND_MSG)
|
|
48
50
|
y = cp.random.rand(*d, dtype=dtype)
|
|
49
|
-
return Tensor(y, dtype=dtype)
|
|
51
|
+
return Tensor(y, dtype=dtype, requires_grad=requires_grad)
|
|
50
52
|
|
|
51
53
|
@overload
|
|
52
|
-
def randn(*, device: DeviceLike = "cpu") -> TensorLike: ...
|
|
54
|
+
def randn(*, device: DeviceLike = "cpu", requires_grad: bool = False) -> TensorLike: ...
|
|
53
55
|
@overload
|
|
54
56
|
def randn(
|
|
55
57
|
*d: int,
|
|
56
58
|
dtype: Optional[DTypeLike] = None,
|
|
57
|
-
device: DeviceLike = "cpu"
|
|
59
|
+
device: DeviceLike = "cpu",
|
|
60
|
+
requires_grad: bool = False
|
|
58
61
|
) -> TensorLike: ...
|
|
59
62
|
def randn(
|
|
60
63
|
*d: int,
|
|
61
64
|
dtype: Optional[DTypeLike] = None,
|
|
62
|
-
device: DeviceLike = "cpu"
|
|
65
|
+
device: DeviceLike = "cpu",
|
|
66
|
+
requires_grad: bool = False
|
|
63
67
|
) -> TensorLike:
|
|
64
68
|
from ...tensor import Tensor
|
|
65
69
|
if device == "cpu":
|
|
@@ -67,14 +71,15 @@ def randn(
|
|
|
67
71
|
else:
|
|
68
72
|
if cp is None: raise CuPyNotFound(CUPY_NOT_FOUND_MSG)
|
|
69
73
|
y = cp.random.randn(*d, dtype=dtype)
|
|
70
|
-
return Tensor(y, dtype=dtype)
|
|
74
|
+
return Tensor(y, dtype=dtype, requires_grad=requires_grad)
|
|
71
75
|
|
|
72
76
|
def randint(
|
|
73
77
|
low: int,
|
|
74
78
|
high: Optional[int] = None,
|
|
75
79
|
size: Optional[AxisLike] = None,
|
|
76
80
|
dtype: Any = int64,
|
|
77
|
-
device: DeviceLike = "cpu"
|
|
81
|
+
device: DeviceLike = "cpu",
|
|
82
|
+
requires_grad: bool = False
|
|
78
83
|
) -> TensorLike:
|
|
79
84
|
from ...tensor import Tensor
|
|
80
85
|
if device == "cpu":
|
|
@@ -82,14 +87,15 @@ def randint(
|
|
|
82
87
|
else:
|
|
83
88
|
if cp is None: raise CuPyNotFound(CUPY_NOT_FOUND_MSG)
|
|
84
89
|
y = cp.random.randint(low=low, high=high, size=size, dtype=dtype)
|
|
85
|
-
return Tensor(y)
|
|
90
|
+
return Tensor(y, requires_grad=requires_grad)
|
|
86
91
|
|
|
87
92
|
def uniform(
|
|
88
93
|
low: float = 0.0,
|
|
89
94
|
high: float = 1.0,
|
|
90
95
|
size: Optional[AxisLike] = None,
|
|
91
96
|
*,
|
|
92
|
-
device: DeviceLike = "cpu"
|
|
97
|
+
device: DeviceLike = "cpu",
|
|
98
|
+
requires_grad: bool = False
|
|
93
99
|
):
|
|
94
100
|
from ...tensor import Tensor
|
|
95
101
|
if device == "cpu":
|
|
@@ -97,7 +103,7 @@ def uniform(
|
|
|
97
103
|
else:
|
|
98
104
|
if cp is None: raise CuPyNotFound(CUPY_NOT_FOUND_MSG)
|
|
99
105
|
y = cp.random.uniform(low=low, high=high, size=size)
|
|
100
|
-
return Tensor(y)
|
|
106
|
+
return Tensor(y, requires_grad=requires_grad)
|
|
101
107
|
|
|
102
108
|
###
|
|
103
109
|
###
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|