check g++ and gcc version in Ubuntu

check version

gcc --version
g++ --version

Install version

sudo apt-get install -y gcc-4.7
sudo apt-get install -y g++-4.7

Update version

cd /usr/bin
sudo rm gcc
sudo ln -s gcc-4.7 gcc
sudo rm g++
sudo ln -s g++-4.7 g++

check version

ls –al gcc g++
gcc --version
g++ --version
recent article

list method for python

remove()list.remove(value)list = [2, 3, 4, 5, 6, 3] print(list)>> [2, 3, 4, 5, 6, 3]list.remove(3)print(list)>>[2, 4, 5, 6, 3]del()del list[index]list = [2, 3, 4, 5, 6, 3] print(list)>> [2, 3, 4, 5, 6, 3]del list[2]print(list)>...…

computer science deep learning python blogread
previous article

One-hot function implementation in Pytorch

Some frequent one-hot method in PyTorchuse scatter_ functionlabels = [0, 1, 4, 7, 3, 2]one_hot = torch.zeros(6, 8).scatter_(dim = 1, index = labels, value = 1)use index_select() funtionlabels = [0, 1, 4, 7, 3, 2]index = torch.eye(8)one_hot = torch...…

computer science deep learning pytorch blogread