import streamlit as st import torch # Check if GPU is available if torch.cuda.is_available(): # Use GPU for a simple task device = torch.device("cuda") a = torch.rand(1000, 1000).to(device) b = torch.rand(1000, 1000).to(device) c = torch.matmul(a, b) # Ensure GPU is utilized st.text("GPU Utilization should be non-zero during this task.") else: st.text("No GPU available.")