Spaces:
Paused
Paused
Upload spconv_stub/spconv/pytorch.py with huggingface_hub
Browse files
spconv_stub/spconv/pytorch.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""spconv.pytorch stub."""
|
| 2 |
+
import torch
|
| 3 |
+
import torch.nn as nn
|
| 4 |
+
from enum import IntEnum
|
| 5 |
+
|
| 6 |
+
class ConvAlgo:
|
| 7 |
+
Native = 0
|
| 8 |
+
MaskImplicitGemm = 1
|
| 9 |
+
|
| 10 |
+
class SparseConvTensor:
|
| 11 |
+
def __init__(self, features=None, indices=None, spatial_shape=None, batch_size=1):
|
| 12 |
+
self.features = features
|
| 13 |
+
self.indices = indices
|
| 14 |
+
self.spatial_shape = spatial_shape
|
| 15 |
+
self.batch_size = batch_size
|
| 16 |
+
|
| 17 |
+
def SubMConv3d(in_channels, out_channels, kernel_size, bias=True, indice_key=None, algo=None, **kw):
|
| 18 |
+
raise NotImplementedError("spconv stub: SubMConv3d not implemented for ZeroGPU")
|
| 19 |
+
|
| 20 |
+
def SparseConv3d(in_channels, out_channels, kernel_size, stride=1, padding=0, bias=True, indice_key=None, algo=None, **kw):
|
| 21 |
+
raise NotImplementedError("spconv stub: SparseConv3d not implemented for ZeroGPU")
|
| 22 |
+
|
| 23 |
+
def SparseInverseConv3d(in_channels, out_channels, kernel_size, indice_key=None, bias=True, algo=None, **kw):
|
| 24 |
+
raise NotImplementedError("spconv stub: SparseInverseConv3d not implemented for ZeroGPU")
|
| 25 |
+
|
| 26 |
+
def SparseSequential(*args):
|
| 27 |
+
return nn.Sequential(*args)
|