Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit 77b452f

Browse files
committed
Update(auto commit)
1 parent fc9c971 commit 77b452f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

HelloWorld/HelloWorld/HelloWorld/TorchBridge/TorchModule.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ - (nullable instancetype)initWithFileAtPath:(NSString*)filePath {
2222
- (NSArray<NSNumber*>*)predictImage:(void*)imageBuffer {
2323
try {
2424
at::Tensor tensor = torch::from_blob(imageBuffer, {1, 3, 224, 224}, at::kFloat);
25-
c10::InferenceMode();
25+
c10::InferenceMode guard;
2626
auto outputTensor = _impl.forward({tensor}).toTensor();
2727
float* floatBuffer = outputTensor.data_ptr<float>();
2828
if (!floatBuffer) {

0 commit comments

Comments
 (0)