2525
2626from typing import Dict , List , Tuple
2727
28- from Deeploy .DeeployTypes import NetworkContext , NodeTemplate , OperatorRepresentation , VariableBuffer
28+ from Deeploy .DeeployTypes import NetworkContext , OperatorRepresentation , VariableBuffer
29+ from Deeploy .Targets .Generic .Templates .ReshapeTemplate import _GenericReshapeTemplate
2930
3031
31- class _ReshapeTemplate (NodeTemplate ):
32+ class _ReshapeTemplate (_GenericReshapeTemplate ):
3233
3334 def __init__ (self , templateStr ):
3435 super ().__init__ (templateStr )
3536
3637 def alignToContext (self , ctxt : NetworkContext ,
3738 operatorRepresentation : OperatorRepresentation ) -> Tuple [NetworkContext , Dict , List [str ]]:
3839
39- # SCHEREMO: Selectively mark 'indices' dead, since we don't need them
40- if 'indices' in operatorRepresentation .keys ():
41- ctxt .globalObjects [operatorRepresentation ['indices' ]]._deploy = False
42- ctxt .globalObjects [operatorRepresentation ['indices' ]]._live = False
43-
44- # Same for "shape"
45- if "shape" in operatorRepresentation .keys ():
46- ctxt .globalObjects [operatorRepresentation ["shape" ]]._deploy = False
47- ctxt .globalObjects [operatorRepresentation ["shape" ]]._live = False
40+ ctxt , operatorRepresentation , _ = super ().alignToContext (ctxt , operatorRepresentation )
4841
4942 # Get buffers
5043 bufferIn = ctxt .lookup (operatorRepresentation ['data_in' ])
@@ -53,10 +46,6 @@ def alignToContext(self, ctxt: NetworkContext,
5346 bufferOut = ctxt .lookup (operatorRepresentation ['data_out' ])
5447 assert isinstance (bufferOut , VariableBuffer )
5548
56- # Link aliases to each buffer
57- bufferIn .aliases .add (bufferOut .name )
58- bufferOut .aliases .add (bufferIn .name )
59-
6049 # Linking required for tiling
6150 bufferOut ._alias = bufferIn .name
6251
0 commit comments