Skip to content

Instantly share code, notes, and snippets.

View vikene's full-sized avatar
💻
Reduxing 🥇

Vigneash Sundar vikene

💻
Reduxing 🥇
View GitHub Profile
@vikene
vikene / tensor.py
Created August 6, 2018 08:17
Basic Tensors using pytorch tutorial
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
/* -----------------------------------
* 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.
*/
@vikene
vikene / rxhellow.js
Last active July 12, 2017 06:58
Hello world Reactive way
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'),