marc-match-ai / marcai /pl /attribute_selector.py
RvanB's picture
Add files from other repo
fbf7e95
raw
history blame
No virus
281 Bytes
import torch.nn as nn
class AttributeSelector(nn.Module):
def __init__(self, attrs):
super().__init__()
self.attrs = attrs
def forward(self, sim: dict) -> dict:
sim = {key: sim[key] for key in self.attrs if key in sim.keys()}
return sim