Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/apache/singa
/ ones
Function
ones
examples/model_selection/Trails/singa_pkg_code/tensor.py:1801–1804 ·
view source on GitHub ↗
(shape, device=get_default_device())
Source
from the content-addressed store, hash-verified
1799
1800
1801
def
ones(shape, device=get_default_device()):
1802
ret = Tensor(shape, device=device)
1803
ret.set_value(1.0)
1804
return
ret
Callers
nothing calls this directly
Calls
3
set_value
Method · 0.95
get_default_device
Function · 0.85
Tensor
Class · 0.70
Tested by
no test coverage detected