Phone

+919997782184

Email

support@roboticswithpython.com

Geeks of Coding

Join us on Telegram

Viewing 0 reply threads
  • Author
    Posts
    • #1190
      Yash AroraYash Arora
      Keymaster

      Question 1
      How do you convert the following Pandas Dataframe to a tensor:
      df = pd.DataFrame({'A':[11, 33, 22],'B':[3, 3, 2]})

      Answer :
      torch.tensor(df.values)

      Question 2
      what is the result of the following:

      A = torch.tensor([[0, 1, 1], [1, 0, 1]])
      B = torch.tensor([[1, 1], [1, 1], [-1, 1]])
      A_times_B = torch.mm(A,B)

      Answer –
      tensor([[0, 2], [0, 2]])

Viewing 0 reply threads
  • You must be logged in to reply to this topic.