Skip to content

Commit

Permalink
Fix mutable field of dataclass for ONNX
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment committed Jul 3, 2024
1 parent bf511cf commit 4048941
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions backend/src/nodes/impl/onnx/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# It is important that is does not contain types that depend on ONNX.
from __future__ import annotations

from dataclasses import dataclass
from dataclasses import dataclass, field
from typing import Final, Literal, Union

OnnxSubType = Literal["Generic", "RemBg"]
Expand Down Expand Up @@ -45,9 +45,6 @@ def ceil_modulo(x: int, mod: int) -> int:
return w - width, h - height


NO_SIZE_REQ = SizeReq()


@dataclass
class OnnxInfo:
opset: int
Expand All @@ -62,7 +59,7 @@ class OnnxInfo:
input_channels: int | None = None
output_channels: int | None = None

size_req: SizeReq = NO_SIZE_REQ
size_req: SizeReq = field(default_factory=SizeReq)


class OnnxGeneric:
Expand Down

0 comments on commit 4048941

Please sign in to comment.