Skip to content

Commit 79764c1

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 54eb558 commit 79764c1

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

data_structures/binary_tree/non_recursive_segment_tree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def __init__(self, arr: list[T], fnc: Callable[[T, T], T]) -> None:
5959
"""
6060

6161
self.N: int = len(arr)
62-
self.st: list[T] = [cast(T,None) for _ in range(self.N)] + arr
62+
self.st: list[T] = [cast(T, None) for _ in range(self.N)] + arr
6363
self.fn = fnc
6464
self.build()
6565

data_structures/linked_list/doubly_linked_list.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
https://en.wikipedia.org/wiki/Doubly_linked_list
33
"""
4+
45
from __future__ import annotations
56

67
from typing import Any

machine_learning/automatic_differentiation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,9 @@ def gradient(self, target: Variable, source: Variable) -> np.ndarray | None:
258258
"""
259259

260260
# partial derivatives with respect to target
261-
partial_deriv: defaultdict[Variable, np.ndarray] = defaultdict(lambda: np.array(0))
261+
partial_deriv: defaultdict[Variable, np.ndarray] = defaultdict(
262+
lambda: np.array(0)
263+
)
262264
partial_deriv[target] = np.ones_like(target.to_ndarray())
263265

264266
# iterating through each operations in the computation graph

0 commit comments

Comments
 (0)