DepthTensor 2.2.0__tar.gz → 2.2.1__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-2.2.0/src/DepthTensor.egg-info → depthtensor-2.2.1}/PKG-INFO +1 -1
- {depthtensor-2.2.0 → depthtensor-2.2.1}/pyproject.toml +1 -1
- {depthtensor-2.2.0 → depthtensor-2.2.1}/src/DepthTensor/__init__.py +1 -1
- {depthtensor-2.2.0 → depthtensor-2.2.1}/src/DepthTensor/tensor.py +33 -0
- {depthtensor-2.2.0 → depthtensor-2.2.1/src/DepthTensor.egg-info}/PKG-INFO +1 -1
- {depthtensor-2.2.0 → depthtensor-2.2.1}/LICENSE +0 -0
- {depthtensor-2.2.0 → depthtensor-2.2.1}/README.md +0 -0
- {depthtensor-2.2.0 → depthtensor-2.2.1}/setup.cfg +0 -0
- {depthtensor-2.2.0 → depthtensor-2.2.1}/src/DepthTensor/_core/__init__.py +0 -0
- {depthtensor-2.2.0 → depthtensor-2.2.1}/src/DepthTensor/_core/exceptions.py +0 -0
- {depthtensor-2.2.0 → depthtensor-2.2.1}/src/DepthTensor/_core/ops/__init__.py +0 -0
- {depthtensor-2.2.0 → depthtensor-2.2.1}/src/DepthTensor/_core/ops/comparison.py +0 -0
- {depthtensor-2.2.0 → depthtensor-2.2.1}/src/DepthTensor/_core/ops/creation.py +0 -0
- {depthtensor-2.2.0 → depthtensor-2.2.1}/src/DepthTensor/_core/ops/diff.py +0 -0
- {depthtensor-2.2.0 → depthtensor-2.2.1}/src/DepthTensor/_core/ops/elementwise.py +0 -0
- {depthtensor-2.2.0 → depthtensor-2.2.1}/src/DepthTensor/_core/ops/reduction.py +0 -0
- {depthtensor-2.2.0 → depthtensor-2.2.1}/src/DepthTensor/_core/random/__init__.py +0 -0
- {depthtensor-2.2.0 → depthtensor-2.2.1}/src/DepthTensor/_core/random/generator.py +0 -0
- {depthtensor-2.2.0 → depthtensor-2.2.1}/src/DepthTensor/_core/utils.py +0 -0
- {depthtensor-2.2.0 → depthtensor-2.2.1}/src/DepthTensor/autodiff.py +0 -0
- {depthtensor-2.2.0 → depthtensor-2.2.1}/src/DepthTensor/typing.py +0 -0
- {depthtensor-2.2.0 → depthtensor-2.2.1}/src/DepthTensor.egg-info/SOURCES.txt +0 -0
- {depthtensor-2.2.0 → depthtensor-2.2.1}/src/DepthTensor.egg-info/dependency_links.txt +0 -0
- {depthtensor-2.2.0 → depthtensor-2.2.1}/src/DepthTensor.egg-info/requires.txt +0 -0
- {depthtensor-2.2.0 → depthtensor-2.2.1}/src/DepthTensor.egg-info/top_level.txt +0 -0
|
@@ -235,6 +235,11 @@ class Tensor:
|
|
|
235
235
|
return self.copy()
|
|
236
236
|
else:
|
|
237
237
|
if in_place:
|
|
238
|
+
if self.requires_grad:
|
|
239
|
+
raise RuntimeError(
|
|
240
|
+
"In-place operations (device switch) are forbidden on differentiable tensors."
|
|
241
|
+
)
|
|
242
|
+
|
|
238
243
|
self.device = device
|
|
239
244
|
self.prev = () if clear_prev else self.prev
|
|
240
245
|
self.data = xp_array_to_device(self.data, device=device)
|
|
@@ -400,6 +405,10 @@ class Tensor:
|
|
|
400
405
|
)
|
|
401
406
|
|
|
402
407
|
def __iadd__(self, t: OperandLike) -> Tensor:
|
|
408
|
+
if self.requires_grad:
|
|
409
|
+
raise RuntimeError(
|
|
410
|
+
"In-place operations are forbidden on differentiable tensors."
|
|
411
|
+
)
|
|
403
412
|
return add(self, t, in_place=True)
|
|
404
413
|
|
|
405
414
|
def __sub__(self, t: OperandLike) -> Tensor:
|
|
@@ -413,6 +422,10 @@ class Tensor:
|
|
|
413
422
|
)
|
|
414
423
|
|
|
415
424
|
def __isub__(self, t: OperandLike) -> Tensor:
|
|
425
|
+
if self.requires_grad:
|
|
426
|
+
raise RuntimeError(
|
|
427
|
+
"In-place operations are forbidden on differentiable tensors."
|
|
428
|
+
)
|
|
416
429
|
return subtract(self, t, in_place=True)
|
|
417
430
|
|
|
418
431
|
def __mul__(self, t: OperandLike) -> Tensor:
|
|
@@ -426,6 +439,10 @@ class Tensor:
|
|
|
426
439
|
)
|
|
427
440
|
|
|
428
441
|
def __imul__(self, t: OperandLike) -> Tensor:
|
|
442
|
+
if self.requires_grad:
|
|
443
|
+
raise RuntimeError(
|
|
444
|
+
"In-place operations are forbidden on differentiable tensors."
|
|
445
|
+
)
|
|
429
446
|
return multiply(self, t, in_place=True)
|
|
430
447
|
|
|
431
448
|
def __matmul__(self, t: OperandLike) -> Tensor:
|
|
@@ -439,6 +456,10 @@ class Tensor:
|
|
|
439
456
|
)
|
|
440
457
|
|
|
441
458
|
def __imatmul__(self, t: OperandLike) -> Tensor:
|
|
459
|
+
if self.requires_grad:
|
|
460
|
+
raise RuntimeError(
|
|
461
|
+
"In-place operations are forbidden on differentiable tensors."
|
|
462
|
+
)
|
|
442
463
|
return matmul(self, t, in_place=True)
|
|
443
464
|
|
|
444
465
|
def __truediv__(self, t: OperandLike) -> Tensor:
|
|
@@ -452,6 +473,10 @@ class Tensor:
|
|
|
452
473
|
)
|
|
453
474
|
|
|
454
475
|
def __itruediv__(self, t: OperandLike) -> Tensor:
|
|
476
|
+
if self.requires_grad:
|
|
477
|
+
raise RuntimeError(
|
|
478
|
+
"In-place operations are forbidden on differentiable tensors."
|
|
479
|
+
)
|
|
455
480
|
return divide(self, t, in_place=True)
|
|
456
481
|
|
|
457
482
|
def __pow__(self, t: OperandLike) -> Tensor:
|
|
@@ -460,6 +485,10 @@ class Tensor:
|
|
|
460
485
|
)
|
|
461
486
|
|
|
462
487
|
def __ipow__(self, t: OperandLike) -> Tensor:
|
|
488
|
+
if self.requires_grad:
|
|
489
|
+
raise RuntimeError(
|
|
490
|
+
"In-place operations are forbidden on differentiable tensors."
|
|
491
|
+
)
|
|
463
492
|
return power(self, t, in_place=True)
|
|
464
493
|
|
|
465
494
|
###
|
|
@@ -495,6 +524,10 @@ class Tensor:
|
|
|
495
524
|
return self.data[index]
|
|
496
525
|
|
|
497
526
|
def __setitem__(self, index, value) -> Any:
|
|
527
|
+
if self.requires_grad:
|
|
528
|
+
raise RuntimeError(
|
|
529
|
+
"In-place operations (indexing) are forbidden on differentiable tensors."
|
|
530
|
+
)
|
|
498
531
|
self.data[index] = value
|
|
499
532
|
|
|
500
533
|
def __iter__(self) -> Iterator:
|
|
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
|