MCPcopy
hub / github.com/THUDM/CogDL / contiguous

Method contiguous

cogdl/data/data.py:117–121  ·  view source on GitHub ↗

r"""Ensures a contiguous memory layout for all attributes :obj:`*keys`. If :obj:`*keys` is not given, all present attributes are ensured to have a contiguous memory layout.

(self, *keys)

Source from the content-addressed store, hash-verified

115 return self
116
117 def contiguous(self, *keys):
118 r"""Ensures a contiguous memory layout for all attributes :obj:`*keys`.
119 If :obj:`*keys` is not given, all present attributes are ensured to
120 have a contiguous memory layout."""
121 return self.apply(lambda x: x.contiguous(), *keys)
122
123 def to(self, device, *keys):
124 r"""Performs tensor dtype and/or device conversion to all attributes

Callers 15

process_jsonFunction · 0.80
Dgraph_DataloaderFunction · 0.80
forwardMethod · 0.80
mh_spmmFunction · 0.80
backwardMethod · 0.80
backwardMethod · 0.80
backwardMethod · 0.80
backwardMethod · 0.80
backwardMethod · 0.80
backwardMethod · 0.80
forwardMethod · 0.80
from_data_listMethod · 0.80

Calls 1

applyMethod · 0.95

Tested by

no test coverage detected