MCPcopy Index your code
hub / github.com/dmlc/dgl / initializer

Function initializer

python/dgl/distributed/optim/pytorch/sparse_optim.py:451–462  ·  view source on GitHub ↗

Sparse optimizer state initializer Parameters ---------- shape : tuple of ints The shape of the state tensor dtype : torch dtype The data type of the state tensor

(shape, dtype)

Source from the content-addressed store, hash-verified

449
450
451def initializer(shape, dtype):
452 """Sparse optimizer state initializer
453
454 Parameters
455 ----------
456 shape : tuple of ints
457 The shape of the state tensor
458 dtype : torch dtype
459 The data type of the state tensor
460 """
461 arr = th.zeros(shape, dtype=dtype)
462 return arr
463
464
465class SparseAdagrad(DistSparseGradOptimizer):

Callers 3

add_columnMethod · 0.50
add_rowsMethod · 0.50
_appendMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected