Skip to content

Instantly share code, notes, and snippets.

@gu-ma
gu-ma / pytorch-glumpy.md
Created January 21, 2021 16:11 — forked from victor-shepardson/pytorch-glumpy.md
using pycuda and glumpy to draw pytorch GPU tensors to the screen without copying to host memory
@gu-ma
gu-ma / pytorch-glumpy.py
Created January 21, 2021 16:11 — forked from victor-shepardson/pytorch-glumpy.py
using pycuda and glumpy to draw pytorch GPU tensors to the screen without copying to host memory
from contextlib import contextmanager
import numpy as np
import torch
from torch import Tensor, ByteTensor
import torch.nn.functional as F
from torch.autograd import Variable
import pycuda.driver
from pycuda.gl import graphics_map_flags
from glumpy import app, gloo, gl