tensorneko 0.3.15__py3-none-any.whl → 0.3.17__py3-none-any.whl

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.
tensorneko/__init__.py CHANGED
@@ -1,7 +1,6 @@
1
1
  import os.path
2
2
 
3
3
  from . import backend
4
- from . import callback
5
4
  from . import dataset
6
5
  from . import debug
7
6
  from . import evaluation
@@ -14,14 +13,11 @@ from . import preprocess
14
13
  from . import util
15
14
  from . import visualization
16
15
  from .io import read, write
17
- from .neko_model import NekoModel
18
16
  from .neko_module import NekoModule
19
- from .neko_trainer import NekoTrainer
20
17
 
21
18
  __version__ = io.read.text(os.path.join(util.get_tensorneko_path(), "version.txt"))
22
19
 
23
20
  __all__ = [
24
- "callback",
25
21
  "dataset",
26
22
  "backend",
27
23
  "evaluation",
@@ -34,11 +30,28 @@ __all__ = [
34
30
  "util",
35
31
  "visualization",
36
32
  "debug",
37
- "NekoModel",
38
- "NekoTrainer",
39
33
  "NekoModule",
40
34
  "read",
41
35
  "write",
42
36
  ]
43
37
 
38
+ try:
39
+ from . import callback
40
+ except ImportError:
41
+ pass
42
+ else:
43
+ __all__.append("callback")
44
44
 
45
+ try:
46
+ from .neko_model import NekoModel
47
+ except ImportError:
48
+ pass
49
+ else:
50
+ __all__.append("NekoModel")
51
+
52
+ try:
53
+ from .neko_trainer import NekoTrainer
54
+ except ImportError:
55
+ pass
56
+ else:
57
+ __all__.append("NekoTrainer")
@@ -15,6 +15,7 @@ from .dispatched_misc import sparse2binary, binary2sparse
15
15
  from .reproducibility import Seed
16
16
  from .string_getter import get_activation, get_loss
17
17
  from .type import ModuleFactory, Shape, Device
18
+ from .gc import run_gc
18
19
 
19
20
  Rearrange = _Rearrange
20
21
 
@@ -77,4 +78,5 @@ __all__ = [
77
78
  "download_files_thread",
78
79
  "WindowMerger",
79
80
  "Registry",
81
+ "run_gc"
80
82
  ]
tensorneko/util/gc.py ADDED
@@ -0,0 +1,11 @@
1
+ # clear gc for python, pytorch, etc
2
+ import gc
3
+ import torch.cuda
4
+
5
+
6
+ def run_gc():
7
+ """
8
+ Clear memory for Python, PyTorch, etc.
9
+ """
10
+ gc.collect()
11
+ torch.cuda.empty_cache()
tensorneko/version.txt CHANGED
@@ -1 +1 @@
1
- 0.3.15
1
+ 0.3.17
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tensorneko
3
- Version: 0.3.15
3
+ Version: 0.3.17
4
4
  Summary: Tensor Neural Engine Kompanion. An util library based on PyTorch and PyTorch Lightning.
5
5
  Home-page: https://github.com/ControlNet/tensorneko
6
6
  Author: ControlNet
@@ -23,19 +23,19 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
23
  Classifier: Topic :: Utilities
24
24
  Requires-Python: >=3.8
25
25
  Description-Content-Type: text/markdown
26
- License-File: LICENSE
27
- Requires-Dist: torch >=1.9.0
28
- Requires-Dist: torchaudio >=0.9.0
29
- Requires-Dist: torchvision >=0.10.0
30
- Requires-Dist: torchmetrics >=0.7.3
31
- Requires-Dist: tensorboard >=2.0.0
32
- Requires-Dist: lightning <2.2,>=2.0
33
- Requires-Dist: pillow >=8.1
34
- Requires-Dist: av >=8.0.3
35
- Requires-Dist: numpy >=1.20.1
36
- Requires-Dist: einops >=0.3.0
37
- Requires-Dist: tensorneko-util ==0.3.15
38
- Requires-Dist: pysoundfile >=0.9.0 ; platform_system == "Windows"
26
+ Requires-Dist: av (>=8.0.3)
27
+ Requires-Dist: einops (>=0.3.0)
28
+ Requires-Dist: numpy (>=1.20.1)
29
+ Requires-Dist: pillow (>=8.1)
30
+ Requires-Dist: tensorneko-util (==0.3.17)
31
+ Requires-Dist: torch (>=1.9.0)
32
+ Requires-Dist: torchaudio (>=0.9.0)
33
+ Requires-Dist: torchmetrics (>=0.7.3)
34
+ Requires-Dist: torchvision (>=0.10.0)
35
+ Requires-Dist: pysoundfile (>=0.9.0) ; platform_system == "Windows"
36
+ Provides-Extra: lightning
37
+ Requires-Dist: lightning (<2.2,>=2.0) ; extra == 'lightning'
38
+ Requires-Dist: tensorboard (>=2.0.0) ; extra == 'lightning'
39
39
 
40
40
  <h1 style="text-align: center">TensorNeko</h1>
41
41
 
@@ -64,8 +64,11 @@ Tensor Neural Engine Kompanion. An util library based on PyTorch and PyTorch Lig
64
64
 
65
65
  ## Install
66
66
 
67
+ The tensorneko requires pytorch and pytorch-lightning (optional), and you can install it with below command.
68
+
67
69
  ```shell
68
- pip install tensorneko
70
+ pip install tensorneko # for PyTorch only
71
+ pip install tensorneko[lightning] # for PyTorch and Lightning
69
72
  ```
70
73
 
71
74
  To use the library without PyTorch and PyTorch Lightning, you can install the util library (support Python 3.7 ~ 3.12 with limited features) with following command.
@@ -273,7 +276,7 @@ t0 = time.time()
273
276
  with Server(view, port=8000):
274
277
  for i, data in enumerate(data_list):
275
278
  preprocessing(data) # do some processing here
276
-
279
+
277
280
  x = time.time() - t0 # time since the start of the program
278
281
  y = i # processed number of data
279
282
  line_chart.add(x, y) # add to the line chart
@@ -494,7 +497,7 @@ def process_data(n: int):
494
497
  return n
495
498
  else:
496
499
  return None
497
-
500
+
498
501
 
499
502
  data = get_data()
500
503
  data = data.map(process_data).get_or_else(-1) # if the response is None, return -1
@@ -1,8 +1,8 @@
1
- tensorneko/__init__.py,sha256=lLVC4StQ5q9OFJTceNrJbj-CIFHFMRvFQyGYJTjuRM4,812
1
+ tensorneko/__init__.py,sha256=uh1HNn1sNpX1bbOqAE_kNJfrH4eMtEzus0hO-Fh9tEw,990
2
2
  tensorneko/neko_model.py,sha256=QTbdOAg9ki0ix6mDL_Qu8Wmd5WJOoUFF3M1SXEp3KGc,10551
3
3
  tensorneko/neko_module.py,sha256=qELXvguSjWo_NvcRQibiFl0Qauzd9JWLSnT4dbGNS3Y,1473
4
4
  tensorneko/neko_trainer.py,sha256=JC8qoKSZ5ngz3grf3S0SjvIFVktDIP_GExth5aFfbGA,10074
5
- tensorneko/version.txt,sha256=G9xsooAOFSfDHEuC_syU1UK-FLNztcrz3G6L4qv-6vM,6
5
+ tensorneko/version.txt,sha256=sOiNkmvwnZw9dn4Od6oRM8jDNFGeaDoTmEVv7sd2w2k,6
6
6
  tensorneko/arch/__init__.py,sha256=w4lTUeyBIZelrnSjlBFWUF0erzOmBFl9FqeWQuSOyKs,248
7
7
  tensorneko/arch/auto_encoder.py,sha256=j6PWWyaNYaYNtw_zZ9ikzhCASqe9viXR3JGBIXSK92Y,2137
8
8
  tensorneko/arch/binary_classifier.py,sha256=1MkEbReXKLdDksRG5Rsife40grJk08EVDcNKp54Xvb4,2316
@@ -73,9 +73,10 @@ tensorneko/preprocess/enum.py,sha256=Wp5qFaUjea5XU4o3N0WxUd-qfzI-m5vr4ZWSqWjELb4
73
73
  tensorneko/preprocess/pad.py,sha256=b4IbbhGNRotZ7weZcKA7hfDqSixPo5KjM6khnqzaeUA,3238
74
74
  tensorneko/preprocess/resize.py,sha256=hitMlzVnN6n_8nEJwxy4C4ErZrTwpM86QGnYewsrmf8,3469
75
75
  tensorneko/preprocess/face_detector/__init__.py,sha256=_ktIfUZqGTX0hk7RBgKf-zHwG2n9KRH4RS7rjuOI8Bo,262
76
- tensorneko/util/__init__.py,sha256=ztsBVn3NLJanwcYyNYyLtUnws6xLcgP3oHMpkjUQh1o,2172
76
+ tensorneko/util/__init__.py,sha256=1ygIyTqZm1ROCsgQJ9_df5TOezyHx08stMDGjtyMxhE,2208
77
77
  tensorneko/util/configuration.py,sha256=xXeAjDh1FCNTmSPwDdkL-uH-ULfzFF6Fg0LT7gsZ6nQ,2510
78
78
  tensorneko/util/dispatched_misc.py,sha256=_0Go7XezdYB7bpMnCs1MDD_6mPNoWP5qt8DoKuPxynI,997
79
+ tensorneko/util/gc.py,sha256=P3bOZ-2VUNyswnfVz5xfj__ecTSAHpu_kLp2wFcpb6M,185
79
80
  tensorneko/util/misc.py,sha256=LEvACtGDOX43iK86A8-Cek0S9rbXFR0AtTP1edE3XDI,4701
80
81
  tensorneko/util/reproducibility.py,sha256=sw1vVi7VOnmzQYUocI5x9yKeZoHHiA4A5ja136XolrI,2102
81
82
  tensorneko/util/string_getter.py,sha256=Cq2mDYr3q758xJ9OBTwLDf-b6EMSYwlnNB0-kfsElfs,2491
@@ -85,8 +86,8 @@ tensorneko/visualization/log_graph.py,sha256=NvOwWVc_petXWYdgaHosPFLa43sHBeacbYc
85
86
  tensorneko/visualization/matplotlib.py,sha256=xs9Ssc44ojZX65QU8-fftA7Ug_pBuZ3TBtM8vETNq9w,1568
86
87
  tensorneko/visualization/image_browser/__init__.py,sha256=AtykhAE3bXQS6SOWbeYFeeUE9ts9XOFMvrL31z0LoMg,63
87
88
  tensorneko/visualization/watcher/__init__.py,sha256=Nq752qIYvfRUZ8VctKQRSqhxh5KmFbWcqPfZlijVx6s,379
88
- tensorneko-0.3.15.dist-info/LICENSE,sha256=Vd75kwgJpVuMnCRBWasQzceMlXt4YQL13ikBLy8G5h0,1067
89
- tensorneko-0.3.15.dist-info/METADATA,sha256=ul7vopVVtLMuxQjnlc6L6srzKooifZT_yOJYqPR9Di8,19743
90
- tensorneko-0.3.15.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
91
- tensorneko-0.3.15.dist-info/top_level.txt,sha256=sZHwlP0iyk7_zHuhRHzSBkdY9yEgyC48f6UVuZ6CvqE,11
92
- tensorneko-0.3.15.dist-info/RECORD,,
89
+ tensorneko-0.3.17.dist-info/LICENSE,sha256=Vd75kwgJpVuMnCRBWasQzceMlXt4YQL13ikBLy8G5h0,1067
90
+ tensorneko-0.3.17.dist-info/METADATA,sha256=cezBL0TH1cdY0Sct7GCGLK9jW0ckUXZIL7PRScTckBg,19998
91
+ tensorneko-0.3.17.dist-info/WHEEL,sha256=g4nMs7d-Xl9-xC9XovUrsDHGXt-FT0E17Yqo92DEfvY,92
92
+ tensorneko-0.3.17.dist-info/top_level.txt,sha256=sZHwlP0iyk7_zHuhRHzSBkdY9yEgyC48f6UVuZ6CvqE,11
93
+ tensorneko-0.3.17.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: bdist_wheel (0.34.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5