텐서 확인 및 추가하기
온도 데이터를 수집하는 동안 측정값이 2도만큼 낮게 표시된다는 것을 발견했어요. adjustment 텐서와의 호환성을 확인하기 위해, 먼저 torch로 temperatures 텐서의 모양과 데이터 유형을 확인한 다음 temperatures 텐서에 2도를 더하세요.
torch 라이브러리와 temperatures 텐서는 이미 로드되어 있어요.
이 연습은 강의의 일부입니다
PyTorch로 배우는 딥러닝 입문
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
adjustment = torch.tensor([[2, 2, 2], [2, 2, 2]])
# Display the shape of the adjustment tensor
print("Adjustment shape:", adjustment.____)
# Display the type of the adjustment tensor
print("Adjustment type:", adjustment.____)
print("Temperatures shape:", temperatures.shape)
print("Temperatures type:", temperatures.dtype)