Skip to content

Adding logging calls for raft and vit #5044

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions torchvision/models/optical_flow/raft.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from torch.nn.modules.instancenorm import InstanceNorm2d
from torchvision.ops import ConvNormActivation

from ...utils import _log_api_usage_once
from ._utils import grid_sample, make_coords_grid, upsample_flow


Expand Down Expand Up @@ -432,6 +433,7 @@ def __init__(self, *, feature_encoder, context_encoder, corr_block, update_block
If ``None`` (default), the flow is upsampled using interpolation.
"""
super().__init__()
_log_api_usage_once(self)

self.feature_encoder = feature_encoder
self.context_encoder = context_encoder
Expand Down
2 changes: 2 additions & 0 deletions torchvision/prototype/models/vision_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import torch.nn as nn
from torch import Tensor

from ...utils import _log_api_usage_once
from ._api import WeightsEnum
from ._utils import handle_legacy_interface

Expand Down Expand Up @@ -139,6 +140,7 @@ def __init__(
norm_layer: Callable[..., torch.nn.Module] = partial(nn.LayerNorm, eps=1e-6),
):
super().__init__()
_log_api_usage_once(self)
torch._assert(image_size % patch_size == 0, "Input shape indivisible by patch size!")
self.image_size = image_size
self.patch_size = patch_size
Expand Down