Skip to content

Commit

Permalink
Re-sync with internal repository (facebookresearch#341)
Browse files Browse the repository at this point in the history
Co-authored-by: Facebook Community Bot <[email protected]>
  • Loading branch information
facebook-github-bot and facebook-github-bot authored Sep 30, 2022
1 parent 3f7141c commit 905cfbd
Show file tree
Hide file tree
Showing 65 changed files with 46 additions and 46 deletions.
4 changes: 2 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[run]
omit =
*test/*
*tests/*
*examples/*

[report]
omit =
*test/*
*tests/*
*examples/*
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import pytest
import torch
from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torch import nn, Tensor
from torchmultimodal.models.albef.image_encoder import ALBEFVisionEncoder
from torchmultimodal.models.albef.model import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import pytest
import torch
from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torch import Tensor
from torchmultimodal.models.albef.image_encoder import ALBEFVisionEncoder

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import pytest
import torch
from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torch import Tensor
from torchmultimodal.models.albef.multimodal_encoder import ALBEFMultimodalEncoder

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import pytest
import torch
from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torchmultimodal.models.clip.image_encoder import ResNetForCLIP
from torchmultimodal.models.clip.model import CLIP
from torchmultimodal.models.clip.text_encoder import CLIPTextEncoder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest

import torch
from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torch import Tensor
from torchmultimodal.models.clip.image_encoder import CLIPViTEncoder, ResNetForCLIP
from torchmultimodal.utils.common import get_current_device
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import pytest
import torch
from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torchmultimodal.models.clip.text_encoder import CLIPTextEncoder


Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import pytest
import torch
from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torchmultimodal.models.flava.model import (
flava_model,
flava_model_for_classification,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest

import torch
from test.test_utils import assert_expected, assert_expected_namedtuple, set_rng_seed
from tests.test_utils import assert_expected, assert_expected_namedtuple, set_rng_seed
from torch import nn
from torchmultimodal.models.flava.model import (
flava_image_encoder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest

import torch
from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torch import nn
from torchmultimodal.models.flava.image_encoder import ImageEmbeddings, ImageTransformer
from torchmultimodal.modules.layers.transformer import TransformerEncoder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pytest

import torch
from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torch import nn
from torchmultimodal.models.flava.transformer import init_transformer_weights
from torchmultimodal.modules.encoders.bert_text_encoder import BERTTextEncoder
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import unittest

import torch
from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torchmultimodal.models.mdetr.image_encoder import mdetr_resnet101_backbone


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest
import torch

from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torchmultimodal.models.mdetr.model import (
mdetr_for_phrase_grounding,
mdetr_for_vqa,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import torch

from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torchmultimodal.models.mdetr.text_encoder import ModifiedTransformerEncoder


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest
import torch

from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torchmultimodal.models.mdetr.transformer import MDETRTransformer


Expand Down
3 changes: 2 additions & 1 deletion test/models/test_gpt.py → tests/models/test_gpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import pytest

import torch
from test.test_utils import assert_expected, assert_expected_namedtuple, set_rng_seed

from tests.test_utils import assert_expected, assert_expected_namedtuple, set_rng_seed
from torch import nn
from torch.nn import functional as F
from torchmultimodal.models.gpt import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest

import torch
from test.test_utils import assert_expected
from tests.test_utils import assert_expected
from torchmultimodal.models.late_fusion import LateFusion
from torchmultimodal.modules.fusions.concat_fusion import ConcatFusionModule

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import torch
import torchmultimodal.models.omnivore as omnivore

from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torchmultimodal.utils.common import get_current_device


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pytest

import torch
from test.test_utils import assert_expected
from tests.test_utils import assert_expected
from torch import nn, Tensor
from torchmultimodal.models.late_fusion import LateFusion
from torchmultimodal.models.two_tower import TwoTower
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import torch

from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed

from torchmultimodal.models.video_gpt import video_gpt, video_vqvae

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import pytest
import torch
from test.test_utils import assert_expected, assert_expected_namedtuple, set_rng_seed
from tests.test_utils import assert_expected, assert_expected_namedtuple, set_rng_seed

from torchmultimodal.models.video_vqvae import (
AttentionResidualBlock,
Expand Down
2 changes: 1 addition & 1 deletion test/models/test_vqvae.py → tests/models/test_vqvae.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import torch

from test.test_utils import assert_expected, assert_expected_namedtuple, set_rng_seed
from tests.test_utils import assert_expected, assert_expected_namedtuple, set_rng_seed
from torch import nn

from torchmultimodal.models.vqvae import VQVAE
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import pytest
import torch
from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torch import Tensor
from torchmultimodal.modules.encoders.bert_text_encoder import bert_text_encoder

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import unittest

import torch
from test.test_utils import assert_expected
from tests.test_utils import assert_expected
from torch import nn
from torchmultimodal.modules.encoders.embedding_encoder import EmbeddingEncoder

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import torch

from test.test_utils import set_rng_seed
from tests.test_utils import set_rng_seed
from torchmultimodal.modules.encoders.swin_transformer_3d_encoder import (
PatchEmbed3d,
PatchMerging,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
# LICENSE file in the root directory of this source tree.

import unittest
from copy import deepcopy

import torch
from test.test_utils import assert_expected
from tests.test_utils import assert_expected
from torch import nn
from torchmultimodal.modules.encoders.weighted_embedding_encoder import (
WeightedEmbeddingEncoder,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import torch

from test.test_utils import assert_expected
from tests.test_utils import assert_expected
from torchmultimodal.modules.layers.activation import SiLU


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pytest

import torch
from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torchmultimodal.modules.layers.attention import (
AxialAttention,
AxialAttentionBlock,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import pytest

import torch
from test.test_utils import assert_expected, assert_expected_namedtuple, set_rng_seed
from tests.test_utils import assert_expected, assert_expected_namedtuple, set_rng_seed
from torch import nn, tensor
from torchmultimodal.modules.layers.codebook import Codebook

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from itertools import product

import torch
from test.test_utils import assert_expected
from tests.test_utils import assert_expected
from torchmultimodal.modules.layers.conv import (
calculate_same_padding,
calculate_transpose_padding,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from functools import partial

import torch
from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torch import nn
from torchmultimodal.modules.layers.mlp import MLP

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest

import torch
from test.test_utils import assert_expected
from tests.test_utils import assert_expected
from torch import nn
from torchmultimodal.modules.layers.position_embedding import (
BroadcastedPositionEmbedding,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import pytest
import torch
from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torchmultimodal.modules.layers.text_embedding import BERTTextEmbeddings


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest

import torch
from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torch import nn
from torchmultimodal.modules.layers.transformer import (
TransformerCrossAttentionLayer,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import pytest
import torch
from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torch import Tensor
from torchmultimodal.modules.losses.albef import (
CausalLanguageModelingLoss,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import unittest

import torch
from test.test_utils import assert_expected
from tests.test_utils import assert_expected
from torchmultimodal.modules.losses.vqvae import CommitmentLoss


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import torch.nn as nn
import torch.optim as optim

from test.test_utils import (
from tests.test_utils import (
assert_expected,
gpu_test,
init_distributed_on_file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import pytest
import torch
from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torchmultimodal.modules.losses.mdetr import box_losses, soft_token_prediction_loss
from torchvision.ops.boxes import box_convert

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest
import torch

from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torchmultimodal.transforms.bert_text_transform import BertTextTransform


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import unittest

import torch
from test.test_utils import assert_expected, get_asset_path, set_rng_seed
from tests.test_utils import assert_expected, get_asset_path, set_rng_seed
from torchmultimodal.transforms.clip_transform import CLIPTransform
from torchvision.transforms import ToPILImage

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest
import torch

from test.test_utils import assert_expected, set_rng_seed
from tests.test_utils import assert_expected, set_rng_seed
from torchmultimodal.transforms.video_transform import VideoTransform


Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree.

import torch
from test.test_utils import assert_expected
from tests.test_utils import assert_expected
from torchmultimodal.utils.attention import get_causal_attention_mask


Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion test/utils/test_common.py → tests/utils/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import torch

from test.test_utils import assert_expected
from tests.test_utils import assert_expected
from torch import nn
from torch.utils.checkpoint import checkpoint
from torchmultimodal.utils.common import (
Expand Down
Loading

0 comments on commit 905cfbd

Please sign in to comment.