커피 한잔 사주세요😄
*메모:
fmod()는 0개 이상의 요소로 구성된 0D 이상의 D 텐서 또는 0개 이상의 요소로 구성된 0D 이상의 D 텐서 중 두 개와 C의 std::fmod의 모듈로(mod) 계산을 수행할 수 있습니다. 스칼라, 아래와 같이 0개 이상의 요소로 구성된 0D 이상의 D 텐서를 가져옵니다.
*메모:
import torch tensor1 = torch.tensor([9, 7, 6]) tensor2 = torch.tensor([[4, -4, 3], [-2, 5, -5]]) torch.fmod(input=tensor1, other=tensor2) tensor1.fmod(other=tensor2) # tensor([[1, 3, 0], [1, 2, 1]]) torch.fmod(input=tensor1, other=4) # tensor([1, 3, 2]) tensor1 = torch.tensor([-9, -7, -6]) tensor2 = torch.tensor([[4, -4, 3], [-2, 5, -5]]) torch.fmod(input=tensor1, other=tensor2) # tensor([[-1, -3, 0], [-1, -2, -1]]) torch.fmod(input=tensor1, other=4) # tensor([-1, -3, -2]) tensor1 = torch.tensor([9.75, 7.08, 6.26]) tensor2 = torch.tensor([[4.26, -4.54, 3.37], [-2.16, 5.43, -5.98]]) torch.fmod(input=tensor1, other=tensor2) # tensor([[1.2300, 2.5400, 2.8900], [1.1100, 1.6500, 0.2800]]) torch.fmod(input=tensor1, other=4.26) # tensor([1.2300, 2.8200, 2.0000])
위 내용은 PyTorch의 fmod의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!