mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-10 06:10:50 +08:00
fix(quant_ops): add detach, clone, and requires_grad_ to mock QuantizedTensor
Signed-off-by: Macpaul Lin <macpaul@gmail.com>
This commit is contained in:
parent
406dab2d53
commit
77a46c68ea
@ -71,6 +71,16 @@ except ImportError as e:
|
||||
|
||||
return type(self)(new_qdata, self._layout_type, new_params)
|
||||
|
||||
def detach(self):
|
||||
return type(self)(self._qdata.detach(), self._layout_type, self._layout_params.copy())
|
||||
|
||||
def clone(self):
|
||||
return type(self)(self._qdata.clone(), self._layout_type, self._layout_params.copy())
|
||||
|
||||
def requires_grad_(self, requires_grad=True):
|
||||
self._qdata.requires_grad_(requires_grad)
|
||||
return self
|
||||
|
||||
def __getattr__(self, name):
|
||||
if name == "params":
|
||||
return self._layout_params
|
||||
|
||||
Loading…
Reference in New Issue
Block a user