You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import*astffrom'@tensorflow/tfjs';import'@tensorflow/tfjs-react-native';importReact,{useCallback,useEffect,useState}from'react';import{Button,Text,View}from'react-native';constApp=()=>{const[isTfReady,setIsTfReady]=useState(false);constloadTFLibrary=useCallback(async()=>{awaittf.ready();console.log('Tensorflow is ready');setIsTfReady(true);},[]);useEffect(()=>{loadTFLibrary();},[loadTFLibrary]);constprintTensor=()=>{if(!isTfReady){console.log('Tensorflow is not ready');return;}constten=tf.zeros([2,2])// This line works properlyconsttens=tf.tensor1d([2],'float32');// getting the error here "TypeError: Cannot read property 'isTypedArray' of undefined, js engine: hermes"};return(<Viewstyle={{flex: 1,alignItems: 'center',justifyContent: 'center'}}><Text>App_Barebone</Text><Buttontitle="Press me"onPress={printTensor}/></View>);};exportdefaultApp;
When I just run const ten = tf.zeros([2,2]) it runs properly and generates a proper tensor.
Now I want to make my custom tensor from the data I provide with an array. At that time, I am getting the above-mentioned error. I have tried with float32, int32, bool, complex64 and string as well but nothing seems to work.
This is information about my system and which versions I am running for different packages:
Hi, I want to perform tensor calculation in my React Native project so I have added this package.
This is my package.json file:
This is my App.tsx:
When I just run
const ten = tf.zeros([2,2])
it runs properly and generates a proper tensor.Now I want to make my custom tensor from the data I provide with an array. At that time, I am getting the above-mentioned error. I have tried with
float32
,int32
,bool
,complex64
andstring
as well but nothing seems to work.This is information about my system and which versions I am running for different packages:
I am not sure if I am missing anything or doing anything wrong. Any help will be greatly appreciated
The text was updated successfully, but these errors were encountered: