Skip to content

Commit 8c0f63e

Browse files
authored
Adopt the new tensor API.
Differential Revision: D61959569 Pull Request resolved: #5066
1 parent 59d83ca commit 8c0f63e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/demo-apps/apple_ios/ExecuTorchDemo/ExecuTorchDemo/Sources/MobileNet/MobileNetClassifier.mm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#import "MobileNetClassifier.h"
1010

1111
#import <executorch/extension/module/module.h>
12+
#import <executorch/extension/tensor/tensor.h>
1213

1314
using namespace ::torch::executor;
1415

@@ -33,9 +34,8 @@ - (BOOL)classifyWithInput:(float*)input
3334
output:(float*)output
3435
outputSize:(NSInteger)outputSize
3536
error:(NSError**)error {
36-
int32_t sizes[] = {1, kChannels, kSize, kSize};
37-
TensorImpl inputTensor(ScalarType::Float, std::size(sizes), sizes, input);
38-
const auto result = _module->forward(Tensor(&inputTensor));
37+
const auto result =
38+
_module->forward(from_blob(input, {1, kChannels, kSize, kSize}));
3939

4040
if (!result.ok()) {
4141
if (error) {

0 commit comments

Comments
 (0)