MCPcopy Create free account
hub / github.com/HealthX-Lab/MedCLIP-SAMv2 / forward

Method forward

saliency_maps/scripts/clip_wrapper.py:72–75  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

70 self.dtype = dtype
71
72 def forward(self, text):
73 x = self.token_embedding(text).type(self.dtype) # [batch_size, n_ctx, d_model]
74 x = x + self.positional_embedding.type(self.dtype)[:x.shape[1], :]#(1,50,512)
75 return x
76
77class text_encoder_wrapper(nn.Module):
78 def __init__(self, model):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected