-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnull.py
More file actions
28 lines (20 loc) · 799 Bytes
/
null.py
File metadata and controls
28 lines (20 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import torch.nn as nn
from ice_station_zebra.types import TensorNCHW
class NullProcessor(nn.Module):
"""Null model that simply returns input
Operations all occur in latent space:
TensorNCHW with (batch_size, latent_channels, latent_height, latent_width)
"""
def __init__(self, n_latent_channels: int) -> None:
super().__init__()
self.n_latent_channels = n_latent_channels
self.model = nn.Identity()
def forward(self, x: TensorNCHW) -> TensorNCHW:
"""
Transformation summary
Args:
x: TensorNCHW with (batch_size, latent_channels, latent_height, latent_width)
Returns:
TensorNCHW with (batch_size, latent_channels, latent_height, latent_width)
"""
return self.model(x)