generated from kyegomez/Python-Package-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGF][]AttentionBasedInflationBlock]
- Loading branch information
Kye
committed
Feb 6, 2024
1 parent
353b1c0
commit 0645977
Showing
2 changed files
with
61 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,24 @@ | ||
import torch | ||
from lumiere.model import ConvolutionBasedInflationBlock | ||
|
||
# Example usage: | ||
# scale_factor must be a divisor of T, H, and W for the example to work correctly | ||
|
||
# B, T, H, W, C | ||
x = torch.randn(1, 2, 112, 112, 3) | ||
|
||
# Create a ConvolutionBasedInflationBlock | ||
block = ConvolutionBasedInflationBlock( | ||
3, 64, (3, 3), (2, 2), (1, 1), scale_factor=2 | ||
in_channels=3, | ||
out_channels=64, | ||
kernel_size=(3, 3), | ||
stride=1, | ||
padding=1, | ||
scale_factor=2, | ||
) | ||
x = torch.randn(1, 4, 224, 224, 3) | ||
|
||
|
||
# Pass the input tensor through the block | ||
out = block(x) | ||
print(out.shape) # Expected shape: [1, 2, 112, 112, 64] | ||
|
||
|
||
# Print the output shape | ||
print(out.shape) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters