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

Method set_value_or_dummy

tensorrt_llm/parameter.py:238–244  ·  view source on GitHub ↗
(self, v: Union[np.ndarray, torch.Tensor])

Source from the content-addressed store, hash-verified

236 self._value = v
237
238 def set_value_or_dummy(self, v: Union[np.ndarray, torch.Tensor]):
239 v = self._regularize_value(v)
240 if v.shape != self._shape:
241 self.value = np.empty(self._shape, trt_dtype_to_np(self._dtype))
242 return
243
244 self.value = v
245
246 def set_name(self, name: str, network):
247 self._name = name

Callers 2

loadMethod · 0.80
loadMethod · 0.80

Calls 3

_regularize_valueMethod · 0.95
trt_dtype_to_npFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected