Skip to content

Commit a3e84aa

Browse files
committed
Move import block
1 parent 29d2493 commit a3e84aa

File tree

9 files changed

+18
-19
lines changed

9 files changed

+18
-19
lines changed

chytorch/nn/losses.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
import torch
3-
from jaxtyping import Bool, Float
42
#
53
# Copyright 2023, 2024 Ramil Nugmanov <nougmanoff@protonmail.com>
64
#
@@ -25,7 +23,8 @@
2523
from torch import float32, zeros_like, exp, Tensor
2624
from torch.nn import Parameter, MSELoss
2725
from torch.nn.modules.loss import _Loss
28-
26+
import torch
27+
from jaxtyping import Bool, Float
2928

3029

3130
class MultiTaskLoss(_Loss):

chytorch/nn/molecule/encoder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
import torch
3-
from jaxtyping import Float
42
#
53
# Copyright 2021-2024 Ramil Nugmanov <nougmanoff@protonmail.com>
64
#
@@ -24,6 +22,8 @@
2422
#
2523
from itertools import repeat
2624
from torch.nn import GELU, Module, ModuleList, LayerNorm
25+
import torch
26+
from jaxtyping import Float
2727

2828
from typing import Tuple, Optional, List
2929
from warnings import warn

chytorch/nn/reaction/encoder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
import torch
3-
from jaxtyping import Float
42
#
53
# Copyright 2021-2023 Ramil Nugmanov <nougmanoff@protonmail.com>
64
#
@@ -25,6 +23,8 @@
2523
from math import inf
2624
from torch import zeros_like, float as t_float
2725
from torch.nn import Embedding, GELU, Module
26+
import torch
27+
from jaxtyping import Float
2828

2929
from ..molecule import MoleculeEncoder
3030
from ..transformer import EncoderLayer

chytorch/nn/voting/binary.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
import torch
3-
from jaxtyping import Float, Int
42
#
53
# Copyright 2022, 2023 Ramil Nugmanov <nougmanoff@protonmail.com>
64
#
@@ -26,6 +24,8 @@
2624
from torch import sigmoid, no_grad
2725
from torch.nn import GELU
2826
from torch.nn.functional import binary_cross_entropy_with_logits
27+
import torch
28+
from jaxtyping import Float, Int
2929

3030
from typing import Union, Optional
3131
from ._kfold import k_fold_mask

chytorch/nn/voting/classifier.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
import torch
3-
from jaxtyping import Float, Int
42
#
53
# Copyright 2022, 2023 Ramil Nugmanov <nougmanoff@protonmail.com>
64
#
@@ -26,6 +24,8 @@
2624
from torch import bmm, no_grad, Tensor
2725
from torch.nn import Dropout, GELU, LayerNorm, LazyLinear, Linear, Module
2826
from torch.nn.functional import cross_entropy, softmax
27+
import torch
28+
from jaxtyping import Float, Int
2929

3030
from typing import Optional, Union
3131
from ._kfold import k_fold_mask

chytorch/nn/voting/regressor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
import torch
3-
from jaxtyping import Float
42
#
53
# Copyright 2022, 2023 Ramil Nugmanov <nougmanoff@protonmail.com>
64
#
@@ -26,6 +24,8 @@
2624
from torch import bmm, no_grad, Tensor
2725
from torch.nn import Dropout, GELU, LayerNorm, LazyLinear, Linear, Module
2826
from torch.nn.functional import smooth_l1_loss
27+
import torch
28+
from jaxtyping import Float
2929

3030
from typing import Optional, Union
3131
from ._kfold import k_fold_mask

chytorch/utils/data/molecule/conformer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
import torch
3-
from jaxtyping import Int
42
#
53
# Copyright 2022-2024 Ramil Nugmanov <nougmanoff@protonmail.com>
64
#
@@ -29,6 +27,8 @@
2927
from torch import IntTensor, Size, zeros, ones as t_ones, int32 as t_int32, eye
3028
from torch.nn.utils.rnn import pad_sequence
3129
from torch.utils.data import Dataset
30+
import torch
31+
from jaxtyping import Int
3232

3333
from typing import Sequence, Tuple, Union, NamedTuple
3434
from .._abc import default_collate_fn_map

chytorch/utils/data/molecule/encoder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
import torch
3-
from jaxtyping import Int
42
#
53
# Copyright 2021-2024 Ramil Nugmanov <nougmanoff@protonmail.com>
64
#
@@ -28,6 +26,8 @@
2826
from torch import IntTensor, Size, int32, ones, zeros, eye, empty, full
2927
from torch.nn.utils.rnn import pad_sequence
3028
from torch.utils.data import Dataset
29+
import torch
30+
from jaxtyping import Int
3131

3232
from typing import Sequence, Union, NamedTuple, Optional, Tuple
3333
from zlib import decompress

chytorch/utils/data/reaction/encoder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
import torch
3-
from jaxtyping import Int
42
#
53
# Copyright 2021-2023 Ramil Nugmanov <nougmanoff@protonmail.com>
64
#
@@ -27,6 +25,8 @@
2725
from torch import IntTensor, cat, zeros, int32, Size, eye
2826
from torch.nn.utils.rnn import pad_sequence
2927
from torch.utils.data import Dataset
28+
import torch
29+
from jaxtyping import Int
3030

3131
from typing import Sequence, Union, NamedTuple
3232
from ..molecule import MoleculeDataset

0 commit comments

Comments
 (0)