Safetensors
tapct
custom_code
TimVeenboer commited on
Commit
fbfd377
·
1 Parent(s): d65c0da

fix: meta tensor device

Browse files
Files changed (1) hide show
  1. vision_transformer_base.py +1 -1
vision_transformer_base.py CHANGED
@@ -270,7 +270,7 @@ class DinoVisionTransformerBase(nn.Module):
270
  if drop_path_uniform is True:
271
  dpr = [drop_path_rate] * depth
272
  else:
273
- dpr = [x.item() for x in torch.linspace(0, drop_path_rate, depth)] # stochastic depth decay rule
274
 
275
  if ffn_layer == DinoVisionTransformerFFNLayer.MLP:
276
  self.logger.info("Using MLP layer as FFN")
 
270
  if drop_path_uniform is True:
271
  dpr = [drop_path_rate] * depth
272
  else:
273
+ dpr = torch.linspace(0, drop_path_rate, depth, device="cpu").tolist() # stochastic depth decay rule
274
 
275
  if ffn_layer == DinoVisionTransformerFFNLayer.MLP:
276
  self.logger.info("Using MLP layer as FFN")