MCPcopy Create free account
hub / github.com/apple/ml-pointersect / __str__

Method __str__

cdslib/core/models/base_model.py:333–350  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

331 return self.forward(*args, **kwargs)
332
333 def __str__(self):
334 s = self.__class__.__name__
335
336 # gather all base models
337 nets = inspect.getmembers(self, lambda v: isinstance(v, BaseModel)) # name, net
338 for name, net in nets:
339 s += "\n"
340 s += f"{name}: "
341 s += str(net)
342
343 # gather all nn.modules
344 nets = inspect.getmembers(self, lambda v: isinstance(v, torch.nn.Module)) # name, net
345 for name, net in nets:
346 s += "\n"
347 s += f"{name}: "
348 s += str(net)
349
350 return s
351
352 @abstractmethod
353 def forward(self, *args, **kwargs):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected