Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

transforms.py 230 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
  1. import torch
  2. import torch.nn as nn
  3. class ConvertBCHWtoCBHW(nn.Module):
  4. """Convert tensor from (B, C, H, W) to (C, B, H, W)"""
  5. def forward(self, vid: torch.Tensor) -> torch.Tensor:
  6. return vid.permute(1, 0, 2, 3)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...