Skip to content

Commit 6fc5659

Browse files
committed
PR fixes
1 parent 9d3e257 commit 6fc5659

File tree

5 files changed

+13
-15
lines changed

5 files changed

+13
-15
lines changed

Deeploy/CommonExtensions/CodeTransformationPasses/Closure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def apply(self,
156156
name: str,
157157
verbose: CodeGenVerbosity = _NoVerbosity) -> Tuple[NetworkContext, ExecutionBlock]:
158158
# Add underscore to avoid name issues when beginning with problematic characters (like numbers)
159-
self.closureName = "op_" + name + self.closureSuffix
159+
self.closureName = "_" + name + self.closureSuffix
160160
self.functionCall = executionBlock.generate(ctxt)
161161
self._generateClosureStruct(ctxt, executionBlock)
162162
ctxt = self._generateClosureCtxt(ctxt, name)

Deeploy/DeeployTypes.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -453,9 +453,9 @@ class ConstantBuffer(VariableBuffer):
453453
454454
"""
455455

456-
def __init__(self, name: str = '', shape = [1], values = [0], alias_of: Optional[List[str]] = None):
456+
def __init__(self, name: str = '', shape = [1], values = [0]):
457457
# Pass a copy of alias_of to avoid shared references
458-
super().__init__(name, shape, list(alias_of) if alias_of is not None else None)
458+
super().__init__(name, shape)
459459

460460
values = np.asarray(values)
461461
# intArray = values.astype(int)
@@ -495,7 +495,6 @@ def fromVariableBuffer(cls, buffer: VariableBuffer, values):
495495
name = buffer.name,
496496
shape = buffer.shape,
497497
values = values,
498-
alias_of = buffer.alias_of,
499498
)
500499

501500
return ret
@@ -595,7 +594,6 @@ def __init__(self,
595594
self.ConstantBuffer = constantBuffer
596595
self.StructBuffer = structBuffer
597596
self.TransientBuffer = transientBuffer
598-
self.n_cores = n_cores
599597
self.name = name
600598
self.n_cores = n_cores
601599

Deeploy/Targets/Generic/Parsers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ def parseNodeCtxt(self,
10901090
output_node.add_aliases(aliases_to_add = new_output_node_aliases)
10911091

10921092
# Add output node as alias to its aliases (alias relationship is symmetric)
1093-
for alias in new_output_node_aliases:
1093+
for alias in input_node.get_aliases_of():
10941094
alias_node = ctxt.lookup(alias)
10951095
alias_node.add_aliases(aliases_to_add = [
10961096
output_node.name,

Deeploy/Targets/PULPOpen/Deployer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ def __init__(self,
6666
]
6767

6868
self.extNameCount = 0
69-
self.n_cores = n_cores
7069

7170
def bind(self):
7271
# SCHEREMO: THIS IS A STOP GAP SOLUTION. DONT REUSE. I MEAN IT. I WILL FIND YOU.

Deeploy/Targets/PULPOpen/Parsers.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def parseNode(self, node: gs.Node) -> (bool):
7777
self.operatorRepresentation['pads'][0] == self.operatorRepresentation['pads'][2],
7878
self.operatorRepresentation['pads'][1] == self.operatorRepresentation['pads'][3],
7979
self.operatorRepresentation['pads'][0] == self.operatorRepresentation['pads'][1],
80+
len(node.inputs) in [2, 3],
8081
])
8182

8283
self.operatorRepresentation['dim_kernel_x'] = int(self.operatorRepresentation['kernel_shape'][0])
@@ -104,12 +105,12 @@ def parseNodeCtxt(self,
104105
inputs = ['data_in', 'weight']
105106

106107
# Handle bias, if present
107-
if len(node.inputs) > 2:
108-
inputs.append("bias")
109-
self.operatorRepresentation["has_bias"] = "true"
110-
else:
108+
if len(node.inputs) == 2:
111109
self.operatorRepresentation["has_bias"] = "false"
112110
self.operatorRepresentation["bias"] = "NULL"
111+
else:
112+
inputs.append("bias")
113+
self.operatorRepresentation["has_bias"] = "true"
113114

114115
for idx, inputNode in enumerate(node.inputs):
115116
self.operatorRepresentation[inputs[idx]] = ctxt.lookup(inputNode.name).name
@@ -170,12 +171,12 @@ def parseNodeCtxt(self,
170171
inputs = ['data_in', 'weight']
171172

172173
# Handle bias, if present
173-
if len(node.inputs) > 2:
174-
inputs.append("bias")
175-
self.operatorRepresentation["has_bias"] = "true"
176-
else:
174+
if len(node.inputs) == 2:
177175
self.operatorRepresentation["has_bias"] = "false"
178176
self.operatorRepresentation["bias"] = "NULL"
177+
else:
178+
inputs.append("bias")
179+
self.operatorRepresentation["has_bias"] = "true"
179180

180181
# Map input nodes to operator representation
181182
for idx, inputNode in enumerate(node.inputs):

0 commit comments

Comments
 (0)