Witllm/tools/test.py

31 lines
727 B
Python
Raw Normal View History

2023-12-21 19:52:19 +08:00
import show
import torch
2024-01-19 14:52:28 +08:00
import mem_tracker
2023-12-21 19:52:19 +08:00
2023-12-21 21:20:49 +08:00
# radata = torch.randn(8192, 128)
# show.DumpTensorToImage(radata, "test.png", autoPad=True,scale=0.2)
radata = torch.randn(127)
show.DumpTensorToImage(radata, "test.png")
2023-12-25 22:53:53 +08:00
2024-01-13 16:48:56 +08:00
2024-01-19 14:52:28 +08:00
radata = torch.randn(3, 127, 127)
2024-01-22 20:57:27 +08:00
show.DumpTensorToImage(radata, "test1.png", AutoContrast=True, GridValue=0)
show.DumpTensorToImage(radata, "test2.png", AutoContrast=True, GridValue=255)
show.DumpTensorToImage(radata, "test3.png", AutoContrast=False, GridValue=0)
2024-01-13 16:48:56 +08:00
2023-12-25 22:53:53 +08:00
radata = torch.randn(127, 127)
show.DumpTensorToLog(radata, "test.log")
2023-12-29 19:55:53 +08:00
radata = torch.randn(127, 127) - 0.5
show.ProbGE0(radata)
show.DumpProb()
2024-01-19 14:52:28 +08:00
radata = torch.randn(127, 127).cuda()
tracker = mem_tracker.MemTracker()
tracker.track()