首页 > 解决方案 > 如何在 tch-rs 中分配单个张量元素?

问题描述

在 Python 中,可以使用索引直接分配 PyTorch 张量元素:

import torch
t = torch.zeros([2,2])
t[0,0] = 1

但是,我在tch-rs

标签: rustpytorchlibtorch

解决方案


推荐阅读