parent
6414c80b82
commit
4c582ef609
2 changed files with 17 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ from functools import reduce
|
|||
from .. import tracer
|
||||
from ..tools import union
|
||||
from .ast import *
|
||||
from .ast import _enum_shape
|
||||
|
||||
|
||||
__all__ = ["Direction", "DIR_NONE", "DIR_FANOUT", "DIR_FANIN", "Layout", "Record"]
|
||||
|
|
@ -34,6 +35,8 @@ class Layout:
|
|||
if len(field) == 2:
|
||||
name, shape = field
|
||||
direction = DIR_NONE
|
||||
if isinstance(shape, type) and issubclass(shape, Enum):
|
||||
shape = _enum_shape(shape)
|
||||
if isinstance(shape, list):
|
||||
shape = Layout.wrap(shape)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue