Skip to content

Commit f77ef9f

Browse files
committed
Add files so that we can merge. VGG state is broken, since it needs normalization, but we need to all use the CMake system.
1 parent adb8dc5 commit f77ef9f

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
use Tensor;
22

33

4-
proc main() {
5-
const a = ndarray.loadPyTorchTensorDictWithKey(2,"models/my_tensor_dict.pt","a");
6-
const b = ndarray.loadPyTorchTensorDictWithKey(2,"models/my_tensor_dict.pt","b");
7-
writeln("a sum: ", a.sum());
8-
writeln("b sum: ", b.sum());
4+
proc main(args: [] string) {
5+
// const a = ndarray.loadPyTorchTensorDictWithKey(2,"models/my_tensor_dict.pt","a");
6+
// const b = ndarray.loadPyTorchTensorDictWithKey(2,"models/my_tensor_dict.pt","b");
7+
// writeln("a sum: ", a.sum());
8+
// writeln("b sum: ", b.sum());
9+
10+
var image = ndarray.loadFrom(args[1],3,real(32));
11+
writeln("Loaded image: ", args[1]);
12+
writeln("Image shape: ", image.shape);
13+
14+
image.saveImage("test.jpg");
915
}

lib/NDArray.chpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2244,7 +2244,7 @@ proc type ndarray.loadImage(imagePath: string, type eltType = defaultEltType): n
22442244
return img;
22452245
}
22462246

2247-
proc ref ndarray.saveImage(imagePath: string) where rank == 3 {
2247+
proc ref ndarray.saveImage(imagePath: string) throws where rank == 3 {
22482248

22492249
// compilerWarning("I have not implemented ndarray.saveImage");
22502250
import Image;

0 commit comments

Comments
 (0)