Skip to content

Commit

Permalink
fixing test case; linux tested script, works
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaybati committed Aug 27, 2023
1 parent e665e8c commit d443048
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
4 changes: 2 additions & 2 deletions examples/run_basic_mac.sh → examples/run_basic_maclinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ make library

#compile "source files" (capiTester.f90), link to the library file created, and run
gfortran -c ../examples/capiTester.f90 -IobjFiles/
gfortran -o flibrary libcorelib.a capiTester.o
gfortran -o flibrary capiTester.o libcorelib.a
./flibrary

#check whether python output from PyTorch model = roseNNa's output
python3 ../test/testChecker.py gemm_small
python3 ../test/testChecker.py gemm_small
8 changes: 0 additions & 8 deletions fLibrary/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ output: $(COMP) $(OBJ2)
%.o: %.f90
$(FC) $(FFLAGS) -c $< -o $@


#preprocess: modelParserONNX.py
# arg1 = model structure file (.onnx format)
# arg2 (optional) = weights file (.onnx format)
#python3 modelParserONNX.py -f $(args)

#for *.mod and *.o files

library: output
mkdir -p objFiles
ar crv libcorelib.a $(COMP) $(OBJ2)
Expand Down
7 changes: 4 additions & 3 deletions fLibrary/modelParserONNX.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,10 @@ def spreadInfo(trueShape, toBeTransformedShape):
names = {n.name:n.i if n.type==2 else n.ints for n in node.attribute}
attributes = [names.get('ceil_mode', 0),
names.get('pads', [0,0,0,0]),
names.get('strides', [1,1])]
modelArch.append(("AveragePool", [ioMap[node.input[0]]], attributes)) #(ceil_mode, pads, strides)
f.write(str(node.attribute[1].ints[0]))
names.get('strides', [1,1]),
names.get('kernel_shape', 0)]
modelArch.append(("AveragePool", [ioMap[node.input[0]]], attributes[:3])) #(ceil_mode, pads, strides)
f.write(str(attributes[-1][0]))
f.write("\n")
ioMap[node.output[0]] = ioMap[node.input[0]]

Expand Down

0 comments on commit d443048

Please sign in to comment.