MCPcopy
hub / github.com/microsoft/Cream / train

Method train

TinyViT/models/tiny_vit.py:255–260  ·  view source on GitHub ↗
(self, mode=True)

Source from the content-addressed store, hash-verified

253
254 @torch.no_grad()
255 def train(self, mode=True):
256 super().train(mode)
257 if mode and hasattr(self, 'ab'):
258 del self.ab
259 else:
260 self.ab = self.attention_biases[:, self.attention_bias_idxs]
261
262 def forward(self, x): # x (B,N,C)
263 B, N, _ = x.shape

Callers 10

train_one_epochFunction · 0.45
train_one_epochFunction · 0.45
train_one_epochFunction · 0.45
train_one_epoch_distillFunction · 0.45
train_one_epochFunction · 0.45
train_one_epochFunction · 0.45
train_one_epochFunction · 0.45
l0module.pyFile · 0.45
train_one_epochFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected