MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT-LLM / __init__

Method __init__

tensorrt_llm/models/clip/model.py:139–156  ·  view source on GitHub ↗
(self, hidden_size, num_attention_heads,
                 max_position_embeddings, norm_epsilon, intermediate_size,
                 hidden_act, num_hidden_layers, mapping: Mapping, dtype)

Source from the content-addressed store, hash-verified

137class CLIPEncoder(Module):
138
139 def __init__(self, hidden_size, num_attention_heads,
140 max_position_embeddings, norm_epsilon, intermediate_size,
141 hidden_act, num_hidden_layers, mapping: Mapping, dtype):
142 super().__init__()
143 self.hidden_size = hidden_size
144 self.dtype = dtype
145 self.mapping = mapping
146
147 self.layers = ModuleList([
148 CLIPEncoderLayer(hidden_size=self.hidden_size,
149 num_attention_heads=num_attention_heads,
150 max_position_embeddings=max_position_embeddings,
151 norm_epsilon=norm_epsilon,
152 intermediate_size=intermediate_size,
153 hidden_act=hidden_act,
154 mapping=self.mapping,
155 dtype=self.dtype) for _ in range(num_hidden_layers)
156 ])
157
158 def forward(self, inputs_embeds):
159

Callers 3

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 2

ModuleListClass · 0.85
CLIPEncoderLayerClass · 0.70

Tested by

no test coverage detected