fluidflow 0.2.2__tar.gz → 0.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fluidflow
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: FluidFlow: models and training utilities for flow matching and diffusion
5
5
  Author-email: David Ramos <david.ramos.archilla@upm.es>
6
6
  Requires-Python: >=3.8
@@ -322,9 +322,8 @@ class DiT(nn.Module):
322
322
  self.t_embedder = TimestepEmbedder(hidden_size, bias=use_bias)
323
323
  self.y_embedder = ConditionEmbedder(cond_dim, hidden_size, class_dropout_prob)
324
324
  num_patches = self.x_embedder.num_patches
325
- # Will use fixed sin-cos embedding:
325
+
326
326
  print(f"Creating DiT with {num_patches} patches.")
327
- self.pos_embed = nn.Parameter(torch.zeros(1, num_patches, hidden_size), requires_grad=False)
328
327
  block_class = partial(WindowBlock, window_size=window_size) if attn_type == "window" else DiTBlock
329
328
  self.blocks = nn.ModuleList(
330
329
  [
@@ -355,10 +354,11 @@ class DiT(nn.Module):
355
354
 
356
355
  # Initialize (and freeze) pos_embed by sin-cos embedding:
357
356
  pos_embed = get_1d_sincos_pos_embed(
358
- self.pos_embed.shape[-1],
357
+ self.hidden_size,
359
358
  self.x_embedder.num_patches
360
359
  )
361
- self.pos_embed.data.copy_(torch.from_numpy(pos_embed).float().unsqueeze(0))
360
+ # Will use fixed sin-cos embedding:
361
+ self.register_buffer("pos_embed", torch.from_numpy(pos_embed).float().unsqueeze(0))
362
362
 
363
363
  # Initialize patch_embed like nn.Linear (instead of nn.Conv2d):
364
364
  w = self.x_embedder.proj.weight.data
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fluidflow
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: FluidFlow: models and training utilities for flow matching and diffusion
5
5
  Author-email: David Ramos <david.ramos.archilla@upm.es>
6
6
  Requires-Python: >=3.8
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
  [project]
6
6
  name = "fluidflow"
7
7
  authors = [{ name = "David Ramos", email = "david.ramos.archilla@upm.es" }]
8
- version = "0.2.2"
8
+ version = "0.2.4"
9
9
  description = "FluidFlow: models and training utilities for flow matching and diffusion"
10
10
  readme = "README.md"
11
11
  requires-python = ">=3.8"
File without changes
File without changes
File without changes
File without changes
File without changes