| 289 | variable_dtype = getattr(torch, variable_dtype) |
| 290 | |
| 291 | class TorchModel(ctranslate2.specs.ModelSpec): |
| 292 | def __init__(self): |
| 293 | super().__init__() |
| 294 | self.dense = common_spec.LinearSpec() |
| 295 | self.dense.weight = torch.ones([16, 4], dtype=variable_dtype) |
| 296 | self.dense.bias = torch.ones([16], dtype=variable_dtype) |
| 297 | |
| 298 | @property |
| 299 | def name(self): |
| 300 | return "TorchModel" |
| 301 | |
| 302 | model = TorchModel() |
| 303 | model.validate() |
no outgoing calls