MCPcopy
hub / github.com/hpcaitech/ColossalAI / forward

Method forward

colossalai/_analyzer/_subclasses/flop_tensor.py:121–125  ·  view source on GitHub ↗
(ctx, *args)

Source from the content-addressed store, hash-verified

119 class PushState(torch.autograd.Function):
120 @staticmethod
121 def forward(ctx, *args):
122 args = tree_map(lambda x: x.clone() if isinstance(x, torch.Tensor) else x, args)
123 if len(args) == 1:
124 return args[0]
125 return args
126
127 @staticmethod
128 def backward(ctx, *grad_outs):

Callers

nothing calls this directly

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected