This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch #import torch | |
X = torch.tensor(1.0) | |
Y = torch.tensor([1.0,2.0]) | |
#Creates two tensor objects | |
#Alternatively we can also create a tensor from data like this | |
Z = torch.tensor([[1.0,2.0,3.0], | |
[2.0,3.0,4.0], | |
[3.0,4.0,5.0]]) | |
#We can also look at the shape of each tensor as follows |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ----------------------------------- | |
* WARNING: | |
* ----------------------------------- | |
* Your code may fail to compile | |
* because it contains public class | |
* declarations. | |
* To fix this, please remove the | |
* "public" keyword from your class | |
* declarations. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var observable = Rx.Observable.create(function(observer){ | |
observer.next("Hello") | |
observer.next("world") | |
observer.complete() | |
}) | |
observable.subscribe({ | |
next: data => console.log(`${data}`), | |
complete: () => console.log('done'), | |
error: err => console.log('error'), |
NewerOlder