Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

get cuda memory pytorch

t = torch.cuda.get_device_properties(0).total_memory
r = torch.cuda.memory_reserved(0)
a = torch.cuda.memory_allocated(0)
f = r-a  # free inside reserved
Comment

cuda memory in pytorch

from pynvml import *
nvmlInit()
h = nvmlDeviceGetHandleByIndex(0)
info = nvmlDeviceGetMemoryInfo(h)
print(f'total    : {info.total}')
print(f'free     : {info.free}')
print(f'used     : {info.used}')
Comment

PREVIOUS NEXT
Code Example
Python :: python get nth letter of alphabet 
Python :: generate random list of number py 
Python :: how to find csrf token python 
Python :: python last element list 
Python :: play music with time in python 
Python :: python prime check 
Python :: pandas query on datetime 
Python :: pandas groupby size column name 
Python :: python enumerate() function 
Python :: date to day python 
Python :: json indent options python 
Python :: letter frequency counter python 
Python :: selenium webdriver 
Python :: Iterate through python string starting at index 
Python :: django unique_together 
Python :: simple colours python 
Python :: python counter least common 
Python :: python candlestick chart 
Python :: how to run for loop in python 
Python :: pretty json python 
Python :: python get computer name 
Python :: python replace first 
Python :: python file location path 
Python :: update print python 
Python :: slack send message python 
Python :: how to encrypt a string python 
Python :: create a df in pandas 
Python :: check if word contains a word in a list python 
Python :: pil image to numpy 
Python :: errno 13 permission denied python 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =