Create cc_projection.py
Browse files
cc_projection/cc_projection.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
from diffusers.configuration_utils import ConfigMixin
|
| 3 |
+
from diffusers.models.modeling_utils import ModelMixin
|
| 4 |
+
|
| 5 |
+
class CCProjection(ModelMixin, ConfigMixin):
|
| 6 |
+
def __init__(self, in_channel=1028, out_channel=1024):
|
| 7 |
+
super().__init__()
|
| 8 |
+
self.in_channel = in_channel
|
| 9 |
+
self.out_channel = out_channel
|
| 10 |
+
self.projection = torch.nn.Linear(in_channel, out_channel)
|
| 11 |
+
|
| 12 |
+
def forward(self, x):
|
| 13 |
+
return self.projection(x)
|