Similar to the Web standard fetch API, this function enables asynchronous transfer of remote tensors.
Example
The function can be used with the await keyword:
// input and output at once consti = sm.randn([128]) constt = awaitsm.network.tfetch('localhost:3000', i)
// no expected return value awaitsm.network.tfetch('localhost:3000', i)
// no input constt = awaitsm.network.tfetch('localhost:3000')
or with a chained callbacks:
sm.network.tfetch('localhost:3000', i).then((t) => { // t is a tensor or null if (t) { console.log(t.shape) } }).catch((err) => { console.log('hit an error retrieving this tensor...') })
Returns
A tensor from the remote location or null (if the response is empty)
Parameters
url: string
The location to either send or request the tensor from.
Similar to the Web standard fetch API, this function enables asynchronous transfer of remote tensors.
Example
The function can be used with the
await
keyword:or with a chained callbacks:
Returns
A tensor from the remote location or null (if the response is empty)