टेंसर्स की जाँच करना और जोड़ना
तापमान डेटा इकट्ठा करते समय, आप देखते हैं कि रीडिंग्स 2 डिग्री से गलत हैं। adjustment टेंसर के साथ अनुकूलता सुनिश्चित करने के लिए torch से उसका shape और data type जाँचने के बाद temperatures टेंसर में 2 डिग्री जोड़ें।
आपके लिए torch लाइब्रेरी और temperatures टेंसर पहले से लोड हैं।
यह अभ्यास पाठ्यक्रम का हिस्सा है
PyTorch के साथ Deep Learning परिचय
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
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)