OpenMotionLab/MotionGPT
118
1# -*- coding: utf-8 -*-2 3# Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is4# holder of all proprietary rights on this computer program.5# You can only use this computer program if you have closed6# a license agreement with MPG or you get the right to use the computer7# program from someone who is authorized to grant you that right.8# Any use of the computer program without a valid license is prohibited and9# liable to prosecution.10#11# Copyright©2020 Max-Planck-Gesellschaft zur Förderung12# der Wissenschaften e.V. (MPG). acting on behalf of its Max Planck Institute13# for Intelligent Systems. All rights reserved.14#15# Contact: ps-license@tuebingen.mpg.de16 17from typing import Optional18from torch import Tensor19 20from .base import Datastruct, dataclass, Transform21 22 23class IdentityTransform(Transform):24 def __init__(self, **kwargs):25 return26 27 def Datastruct(self, **kwargs):28 return IdentityDatastruct(**kwargs)29 30 def __repr__(self):31 return "IdentityTransform()"32 33 34@dataclass35class IdentityDatastruct(Datastruct):36 transforms: IdentityTransform37 38 features: Optional[Tensor] = None39 40 def __post_init__(self):41 self.datakeys = ["features"]42 43 def __len__(self):44 return len(self.rfeats)45 