(model)
| 33 | def replace_opts(ast:UOp, opts:list) -> UOp: return ast.replace(arg=replace(ast.arg, opts_to_apply=tuple(opts))) |
| 34 | |
| 35 | def derandomize_model(model): |
| 36 | for p in get_parameters(model): |
| 37 | p.replace(Tensor.empty(p.shape, device=p.device, dtype=p.dtype)) |
| 38 | p.realize() |
| 39 | |
| 40 | def call_is_graph(call:UOp) -> bool: |
| 41 | ast = call.src[0] |
searching dependent graphs…