Flatten, Reshape, and Squeeze Explained - Tensors for Deep Learning with PyTorch

Flatten, Reshape, and Squeeze Explained - Tensors for Deep Learning with PyTorch

deeplizard

5 лет назад

52,765 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

NAZ STREAM SINI
NAZ STREAM SINI - 24.07.2023 21:59

Oof, i think the bing chat can take that picture and be able to tell that the bridge is dangerous to cross right now meaning the future is now🎉

Ответить
عبدو عيد
عبدو عيد - 18.06.2023 20:54

t.reshape(12) or t.reshape(-1)

Ответить
muthu kamalan .m
muthu kamalan .m - 11.04.2023 21:11

t.flattern() makes my life simpler😅😂

Ответить
Prathamesh Dinkar
Prathamesh Dinkar - 25.07.2022 14:28

Answer for flattening with reshaping : t.reshape([-1])

Ответить
Mûħąɱɱɐɖ Yăşїѓ
Mûħąɱɱɐɖ Yăşїѓ - 12.05.2022 16:59

The other way to flatten the tensor is by using t = t.reshape( -1 ) in flatten(t) function

Ответить
Yogesh Rampariya
Yogesh Rampariya - 01.01.2022 12:03

t.reshape(t.numel()) or t.reshape(tensor(t.shape).prod().... Either of these should work

Ответить
Hans Krieger
Hans Krieger - 04.06.2021 10:45

Gratulations on your 100.000 followers here! :)

Ответить
Andres Almodovar
Andres Almodovar - 10.04.2021 16:46

my answer (t.reshape(-1)). Without looking, I swear

Ответить
TranAnswers
TranAnswers - 27.03.2021 09:21

def flatten(t):

return t.reshape(-1)

Ответить
Usma Bhatt
Usma Bhatt - 30.01.2021 18:15

t.reshape(-1)

Ответить
Caner
Caner - 26.01.2021 02:15

t = t.reshape(12)

Ответить
Amarnath Reddy
Amarnath Reddy - 16.01.2021 17:31

r.reshape(1,torch.tensor(r.shape).prod()).squeeze() for a tensor r

Ответить
snippletrap
snippletrap - 15.01.2021 02:39

Now do scatter()

Ответить
bharadwaj reddy
bharadwaj reddy - 15.12.2020 00:00

t.reshape(1,-1)[0], better late than never :p

Ответить
Muhammad Al-Barham
Muhammad Al-Barham - 13.11.2020 00:43

t.reshape(-1)

Ответить
Christian Blount
Christian Blount - 20.09.2020 06:54

Very good.

Ответить
ROHTASH BENIWAL
ROHTASH BENIWAL - 11.09.2020 18:13

best work u guys are doing, lot of hard work u both did ,to get this knowledge , love from India

Ответить
themelankolis
themelankolis - 21.08.2020 18:50

Nice tutorial! It would be really great if you change the backsound while you write the code. Because it is not that comfortable to hear, especially when you hear with earphone.

Ответить
Utkarsh Kant
Utkarsh Kant - 20.08.2020 18:43

t.reshape(12)

t.reshape(-1)

Ответить