Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/apache/singa
/ ones
Function
ones
python/singa/tensor.py:1838–1841 ·
view source on GitHub ↗
(shape, device=get_default_device())
Source
from the content-addressed store, hash-verified
1836
1837
1838
def
ones(shape, device=get_default_device()):
1839
ret = Tensor(shape, device=device)
1840
ret.set_value(1.0)
1841
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