44. Install PyTorch and First Tensors
44.2 What Is a Tensor
44.2 Tensor म्हणजे काय
NumPy arrays numbers ठेवतात. PyTorch tensors पण — आणि learning साठी gradients track करू शकतात.
हे का शिकायचं?
Why. NumPy arrays numbers ठेवतात. PyTorch tensors पण — आणि learning साठी हवे तेव्हा gradients track करतात.
हे काय आहे?
What. Tensor = multi-dimensional number container: scalar, vector, matrix, किंवा higher. NumPy ndarray सारखं spirit, autograd superpowers सह.
कसं करायचं?
How.
तीन tensors बनावा
- Python list पासून.
- Zeros / ones helpers.
.shapeआणि.dtypecheck करा.
import torch
x = torch.tensor([1.0, 2.0, 3.0])
Z = torch.zeros(2, 3)
print(x, x.shape, x.dtype)
print(Z)
Ravindra Bagale's Tip
A tensor is like a smart box that holds numbers in rows, columns or more dimensions. Always print the shape of your tensors, because many bugs come from a wrong shape, and checking it solves a big part of your debugging.
Ravindra Bagale's Tip – मराठी
Tensor म्हणजे rows, columns किंवा त्याहून जास्त dimensions मध्ये numbers ठेवणारा एक smart box. आपल्या tensors चा shape नेहमी print करा, कारण बरेच bugs चुकीच्या shape मुळे येतात, आणि तो तपासल्याने debugging चा मोठा भाग सुटतो.
Ravindra Bagale's Tip – हिंदी
Tensor एक smart box जैसा है जो rows, columns या उससे ज़्यादा dimensions में numbers रखता है. अपने tensors का shape हमेशा print करो, क्योंकि कई bugs गलत shape से आते हैं, और उसे जाँचने से debugging का बड़ा हिस्सा हल हो जाता है.