From 13741e1b8716297350c72eccf2a05621638efd59 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 17:54:34 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- metnet/layers/ConditionWithTimeMetNet2.py | 1 + metnet/layers/ConvLSTM.py | 1 + metnet/layers/DilatedCondConv.py | 1 + metnet/layers/MBConv.py | 1 + metnet/layers/MaxViT.py | 1 + metnet/layers/MultiheadSelfAttention2D.py | 1 + metnet/layers/PartitionAttention.py | 1 + metnet/layers/RelativePositionBias.py | 1 + metnet/layers/SqueezeExcitation.py | 1 + metnet/layers/StochasticDepth.py | 1 + metnet/models/metnet2.py | 1 + metnet/utils.py | 1 + 12 files changed, 12 insertions(+) diff --git a/metnet/layers/ConditionWithTimeMetNet2.py b/metnet/layers/ConditionWithTimeMetNet2.py index 365e866..9cb1468 100755 --- a/metnet/layers/ConditionWithTimeMetNet2.py +++ b/metnet/layers/ConditionWithTimeMetNet2.py @@ -1,4 +1,5 @@ """Condition with time how MetNet-22 does it, with FiLM layers""" + import einops import torch from torch import nn as nn diff --git a/metnet/layers/ConvLSTM.py b/metnet/layers/ConvLSTM.py index fb0f40c..e7406a8 100755 --- a/metnet/layers/ConvLSTM.py +++ b/metnet/layers/ConvLSTM.py @@ -1,4 +1,5 @@ """Originally adapted from https://github.com/aserdega/convlstmgru, MIT License Andriy Serdega""" + from typing import Any, List, Optional import torch diff --git a/metnet/layers/DilatedCondConv.py b/metnet/layers/DilatedCondConv.py index 704bb0d..84f43b8 100755 --- a/metnet/layers/DilatedCondConv.py +++ b/metnet/layers/DilatedCondConv.py @@ -1,4 +1,5 @@ """Dilated Time Conditioned Residual Convolution Block for MetNet-2""" + import torch import torch.nn as nn import torch.nn.functional as F diff --git a/metnet/layers/MBConv.py b/metnet/layers/MBConv.py index 97a801e..6f8973c 100644 --- a/metnet/layers/MBConv.py +++ b/metnet/layers/MBConv.py @@ -1,6 +1,7 @@ """ MBConv Implementation """ + from typing import Type import torch diff --git a/metnet/layers/MaxViT.py b/metnet/layers/MaxViT.py index ab9cb7b..faa2147 100644 --- a/metnet/layers/MaxViT.py +++ b/metnet/layers/MaxViT.py @@ -1,6 +1,7 @@ """ Implementation of MaxViT module """ + from dataclasses import dataclass from typing import List, Tuple, Type, Union diff --git a/metnet/layers/MultiheadSelfAttention2D.py b/metnet/layers/MultiheadSelfAttention2D.py index eeb9d5e..b516c57 100644 --- a/metnet/layers/MultiheadSelfAttention2D.py +++ b/metnet/layers/MultiheadSelfAttention2D.py @@ -1,6 +1,7 @@ """ MultiHeaded 2D Self Attention Implementation """ + from typing import Type import torch diff --git a/metnet/layers/PartitionAttention.py b/metnet/layers/PartitionAttention.py index 511613f..d3ba587 100644 --- a/metnet/layers/PartitionAttention.py +++ b/metnet/layers/PartitionAttention.py @@ -1,6 +1,7 @@ """ Implementation of Partition (Grid and Block) Attention """ + from typing import Tuple, Type import torch diff --git a/metnet/layers/RelativePositionBias.py b/metnet/layers/RelativePositionBias.py index 2ad537b..ec78c16 100644 --- a/metnet/layers/RelativePositionBias.py +++ b/metnet/layers/RelativePositionBias.py @@ -1,6 +1,7 @@ """ Implementation of Relative Position Bias """ + from typing import Tuple import torch diff --git a/metnet/layers/SqueezeExcitation.py b/metnet/layers/SqueezeExcitation.py index f6b2b27..341b098 100644 --- a/metnet/layers/SqueezeExcitation.py +++ b/metnet/layers/SqueezeExcitation.py @@ -1,6 +1,7 @@ """ Squeeze-and-Excitation net implementation """ + from typing import Type import torch diff --git a/metnet/layers/StochasticDepth.py b/metnet/layers/StochasticDepth.py index 30c2f98..b24ebcb 100644 --- a/metnet/layers/StochasticDepth.py +++ b/metnet/layers/StochasticDepth.py @@ -1,6 +1,7 @@ """ Implementation of Stochastic Depth """ + import torch from torch import nn diff --git a/metnet/models/metnet2.py b/metnet/models/metnet2.py index 570cc6b..461152c 100755 --- a/metnet/models/metnet2.py +++ b/metnet/models/metnet2.py @@ -1,4 +1,5 @@ """MetNet-2 model for weather forecasting""" + from typing import List import torch diff --git a/metnet/utils.py b/metnet/utils.py index bc73fe3..c71eb6e 100644 --- a/metnet/utils.py +++ b/metnet/utils.py @@ -1,4 +1,5 @@ """Utilities""" + import numpy as np