Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

ClassyModelWrapper as nn.Module #805

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
5 changes: 2 additions & 3 deletions classy_vision/models/classy_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __call__(self, *args, **kwargs):
return ret_val


class ClassyModelWrapper:
class ClassyModelWrapper(torch.nn.Module):
"""Base ClassyModel wrapper class.

This class acts as a thin pass through wrapper which lets users modify the behavior
Expand All @@ -68,9 +68,8 @@ class ClassyModelWrapper:
accessed by the `classy_model` attribute.
"""

# TODO: Make this torchscriptable by inheriting from nn.Module / ClassyModel

def __init__(self, classy_model):
super().__init__()
self.classy_model = classy_model

def __getattr__(self, name):
Expand Down