MCPcopy Create free account
hub / github.com/OpenNMT/CTranslate2 / __init__

Method __init__

python/ctranslate2/specs/model_spec.py:721–725  ·  view source on GitHub ↗
(self, tensor)

Source from the content-addressed store, hash-verified

719 """Model variable as a PyTorch tensor."""
720
721 def __init__(self, tensor):
722 if isinstance(tensor, torch.nn.Parameter):
723 tensor = tensor.data
724
725 self.tensor = tensor.contiguous()
726
727 @classmethod
728 def from_numpy(cls, array):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected