patdev commited on
Commit
c8091c9
·
verified ·
1 Parent(s): ef79ec1

Add zero-copy TensorRT PyTorch runtime and AniGen hybrid loader

Browse files
runtime/__pycache__/hybrid_anigen.cpython-311.pyc ADDED
Binary file (3.88 kB). View file
 
runtime/__pycache__/trt_torch.cpython-311.pyc ADDED
Binary file (6.88 kB). View file
 
runtime/trt_torch.py CHANGED
@@ -33,7 +33,7 @@ class TorchTensorRTEngine:
33
  return outs
34
 
35
  class DinoTRT(torch.nn.Module):
36
- def __init__(self, engine_path): super().__init__(); self.engine=TorchTensorRTEngine(engine_path)
37
  def forward(self, pixel_values, is_training=True):
38
  out=self.engine.run({'pixel_values':pixel_values})['x_prenorm']; return {'x_prenorm':out}
39
  def to(self,*a,**k): return self
@@ -41,7 +41,7 @@ class DinoTRT(torch.nn.Module):
41
  def eval(self): return self
42
 
43
  class DsineTRT(torch.nn.Module):
44
- def __init__(self, engine_path): super().__init__(); self.engine=TorchTensorRTEngine(engine_path)
45
  def forward(self, image, intrins):
46
  out=self.engine.run({'image':image,'intrins':intrins})['normal']; return [out]
47
  def to(self,*a,**k): return self
 
33
  return outs
34
 
35
  class DinoTRT(torch.nn.Module):
36
+ def __init__(self, engine_path): super().__init__(); self.engine=TorchTensorRTEngine(engine_path); self.device=torch.device('cuda')
37
  def forward(self, pixel_values, is_training=True):
38
  out=self.engine.run({'pixel_values':pixel_values})['x_prenorm']; return {'x_prenorm':out}
39
  def to(self,*a,**k): return self
 
41
  def eval(self): return self
42
 
43
  class DsineTRT(torch.nn.Module):
44
+ def __init__(self, engine_path): super().__init__(); self.engine=TorchTensorRTEngine(engine_path); self.device=torch.device('cuda')
45
  def forward(self, image, intrins):
46
  out=self.engine.run({'image':image,'intrins':intrins})['normal']; return [out]
47
  def to(self,*a,**k): return self