MCPcopy Create free account
hub / github.com/OpenSparseLLMs/Linear-MoE / wrapper

Function wrapper

linear_moe/utils.py:10–13  ·  view source on GitHub ↗
(ctx, *args, **kwargs)

Source from the content-addressed store, hash-verified

8def contiguous(fn):
9 @functools.wraps(fn)
10 def wrapper(ctx, *args, **kwargs):
11 return fn(ctx,
12 *(i if not isinstance(i, torch.Tensor) else i.contiguous() for i in args),
13 **{k: (v if not isinstance(v, torch.Tensor) else v.contiguous()) for k, v in kwargs.items()})
14 return wrapper
15
16

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected