MCPcopy
hub / github.com/dmlc/dgl / deepclone

Method deepclone

python/dgl/frame.py:901–920  ·  view source on GitHub ↗

Return a deep clone of this frame. The clone frame has an copy of this frame and any modification to the clone frame is not visible to this frame. The function allocate new tensors and copy the contents from this frame. Use :func:`~dgl.Frame.clone` for cloning a frame that d

(self)

Source from the content-addressed store, hash-verified

899 return newframe
900
901 def deepclone(self):
902 """Return a deep clone of this frame.
903
904 The clone frame has an copy of this frame and any modification to the clone frame
905 is not visible to this frame. The function allocate new tensors and copy the contents
906 from this frame. Use :func:`~dgl.Frame.clone` for cloning a frame that does not
907 allocate extra tensor memory.
908
909 Returns
910 -------
911 Frame
912 A deep-cloned frame.
913 """
914 newframe = Frame(
915 {k: col.deepclone() for k, col in self._columns.items()},
916 self._num_rows,
917 )
918 newframe._initializers = self._initializers
919 newframe._default_initializer = self._default_initializer
920 return newframe
921
922 def subframe(self, rowids):
923 """Return a new frame whose columns are subcolumns of this frame.

Callers

nothing calls this directly

Calls 2

FrameClass · 0.85
itemsMethod · 0.45

Tested by

no test coverage detected