Skip to content

Commit

Permalink
Change loop from range to for
Browse files Browse the repository at this point in the history
  • Loading branch information
jgmelber committed Apr 22, 2024
1 parent a89350c commit 0a10ef5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions programming_examples/ml/resnet/layers_conv2_x/aie2.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,12 @@ def deviceBody():
# 1x1 conv2d
@core(ComputeTile2, "conv2dk1.o")
def core_body():
for _ in range_(sys.maxsize):
for _ in for_(sys.maxsize):

# acquire weights once
element0Weights = of_wts_buf_00.acquire(ObjectFifoPort.Consume, 1)
scale = memref.load(rtpComputeTile2, [0])
for _ in range_(tensorInH):
for _ in for_(tensorInH):
element0ActivactionsIn = of_inOF_act_L3L2.acquire(
ObjectFifoPort.Consume, 1
)
Expand Down Expand Up @@ -268,7 +268,7 @@ def core_body():
@core(ComputeTile3, "conv2dk3.o")
def core_body():
scale = 11
for _ in range_(sys.maxsize):
for _ in for_(sys.maxsize):

# acquire weights and rtps once
element0Weights = wts_buf_01.acquire(ObjectFifoPort.Consume, 1)
Expand Down Expand Up @@ -300,7 +300,7 @@ def core_body():
objectfifo_release(ObjectFifoPort.Produce, "act_3_4", 1)

# middle
for _ in range_(tensorInH - 2):
for _ in for_(tensorInH - 2):
elementActivactionsIn = of_act_2_3_5.acquire(
ObjectFifoPort.Consume, 3
)
Expand Down Expand Up @@ -364,7 +364,7 @@ def core_body():
@core(ComputeTile5, "conv2dk3.o")
def core_body():
scale = 11
for _ in range_(sys.maxsize):
for _ in for_(sys.maxsize):

# acquire weights and rtps once
element0Weights = wts_buf_01.acquire(ObjectFifoPort.Consume, 1)
Expand Down Expand Up @@ -397,7 +397,7 @@ def core_body():
objectfifo_release(ObjectFifoPort.Produce, "act_5_4", 1)

# middle
for _ in range_(tensorInH - 2):
for _ in for_(tensorInH - 2):
elementActivactionsIn = of_act_2_3_5.acquire(
ObjectFifoPort.Consume, 3
)
Expand Down Expand Up @@ -458,14 +458,14 @@ def core_body():
# # 1x1 conv2d and add skip
@core(ComputeTile4, "conv2dk1_skip.o")
def core_body():
for _ in range_(sys.maxsize):
for _ in for_(sys.maxsize):

# acquire weights and rtps once
element0Weights = wts_buf_02.acquire(ObjectFifoPort.Consume, 1)
scale = memref.load(rtpComputeTile4, [0])
skipScale = memref.load(rtpComputeTile4, [1])

for _ in range_(tensorInH):
for _ in for_(tensorInH):
element0ActivactionsIn = act_3_4.acquire(
ObjectFifoPort.Consume, 1
)
Expand Down

0 comments on commit 0a10ef5

Please sign in to comment.