MCPcopy Create free account
hub / github.com/pytorch/tutorials / compute_mask

Method compute_mask

intermediate_source/pruning_tutorial.py:362–365  ·  view source on GitHub ↗
(self, t, default_mask)

Source from the content-addressed store, hash-verified

360 PRUNING_TYPE = 'unstructured'
361
362 def compute_mask(self, t, default_mask):
363 mask = default_mask.clone()
364 mask.view(-1)[::2] = 0
365 return mask
366
367######################################################################
368# Now, to apply this to a parameter in an ``nn.Module``, you should

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected