Method
cast_weight
(s, input=None, dtype=None, device=None)
Source from the content-addressed store, hash-verified
| 119 | return r |
| 120 | |
| 121 | def cast_weight(s, input=None, dtype=None, device=None): |
| 122 | if input is not None: |
| 123 | if dtype is None: |
| 124 | dtype = input.dtype |
| 125 | if device is None: |
| 126 | device = input.device |
| 127 | weight = cast_to(s.weight, dtype, device) |
| 128 | return weight |
| 129 | |
| 130 | def cast_bias_weight(s, input=None, dtype=None, device=None, bias_dtype=None): |
| 131 | if input is not None: |
Callers
nothing calls this directly
Tested by
no test coverage detected