This file contains 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
#!/usr/bin/env python | |
# -*- coding:UTF-8 -*- | |
import torch | |
import torch.nn as nn | |
import torch.nn.init as init | |
def weight_init(m): | |
''' |
This file contains 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
from singa import layer | |
from singa import tensor | |
from singa import device | |
# Device to opencl | |
dev = device.create_opencl_device() | |
# Create tensor | |
x = tensor.Tensor((1,3, 32, 32), dev) | |
x.uniform(-1, 1) |