深度学习_3_张量运算

代码:

import torch

import os

import pandas as pd
import numpy as np

x = torch.tensor([[1, 2, 3], [4, 5, 6]])
print(x)
sumA = x.sum(dim = 0)
print(sumA)
print(torch.sum(x, dim = 0, keepdim= True))
print(x/torch.sum(x, dim = 0, keepdim= True) )

深度学习_3_张量运算_第1张图片

你可能感兴趣的:(深度学习,人工智能)