MCPcopy Create free account
hub / github.com/microsoft/TRELLIS / forward

Method forward

trellis/modules/sparse/conv/conv_torchsparse.py:13–19  ·  view source on GitHub ↗
(self, x: SparseTensor)

Source from the content-addressed store, hash-verified

11 self.conv = torchsparse.nn.Conv3d(in_channels, out_channels, kernel_size, stride, 0, dilation, bias)
12
13 def forward(self, x: SparseTensor) -> SparseTensor:
14 out = self.conv(x.data)
15 new_shape = [x.shape[0], self.conv.out_channels]
16 out = SparseTensor(out, shape=torch.Size(new_shape), layout=x.layout if all(s == 1 for s in self.conv.stride) else None)
17 out._spatial_cache = x._spatial_cache
18 out._scale = tuple([s * stride for s, stride in zip(x._scale, self.conv.stride)])
19 return out
20
21
22class SparseInverseConv3d(nn.Module):

Callers

nothing calls this directly

Calls 1

SparseTensorClass · 0.85

Tested by

no test coverage detected