File tree Expand file tree Collapse file tree
packages/react-native-executorch
common/rnexecutorch/models Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -155,13 +155,8 @@ void BaseModel::unload() { module.reset(nullptr); }
155155
156156std::vector<int32_t >
157157BaseModel::getTensorShape (const executorch::aten::Tensor &tensor) {
158- std::vector<int32_t > tensorShape;
159158 auto sizes = tensor.sizes ();
160- tensorShape.reserve (sizes.size ());
161- for (auto size : sizes) {
162- tensorShape.push_back (static_cast <int32_t >(size));
163- }
164- return tensorShape;
159+ return std::vector<int32_t >(sizes.begin (), sizes.end ());
165160}
166161
167162} // namespace rnexecutorch
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ export type TensorBuffer =
5555 | BigUint64Array ;
5656
5757export interface TensorPtr {
58- data : TensorBuffer ;
59- shape : number [ ] ;
58+ dataPtr : TensorBuffer ;
59+ sizes : number [ ] ;
6060 scalarType : ScalarType ;
6161}
You can’t perform that action at this time.
0 commit comments