Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/microsoft/Cream
/ _ntuple
Function
_ntuple
TinyCLIP/src/open_clip/utils.py:50–55 ·
view source on GitHub ↗
(n)
Source
from the content-addressed store, hash-verified
48
49
# From PyTorch internals
50
def
_ntuple(n):
51
def
parse(x):
52
if
isinstance(x, collections.abc.Iterable):
53
return
x
54
return
tuple(repeat(x, n))
55
return
parse
56
57
58
to_1tuple = _ntuple(1)
Callers
2
utils.py
File · 0.70
to_ntuple
Function · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected