dfalbel / torch

torch from R!
http://dfalbel.github.io/torch
Other
51 stars 5 forks source link

Tensor methods #25

Open dfalbel opened 5 years ago

dfalbel commented 5 years ago

Here's a complete list of tensor method we need to implement:

The code used to create the list:

library(httr)
library(xml2)
library(magrittr)

docs <- httr::GET("https://pytorch.org/docs/stable/tensors.html")

docs %>% 
  content() %>% 
  xml2::xml_find_all("//code[@class='descname']") %>% 
  xml2::xml_text() %>% 
  unique() %>% 
  sort() %>% 
  paste0("- [ ] `$", ., "`") %>% 
  cat(sep = "\n")
Athospd commented 5 years ago

Code I wrote to keep track of new/deprecated methods.

library(httr)
library(xml2)
library(magrittr)

# methods listed in docs today
docs_new <- httr::GET("https://pytorch.org/docs/stable/tensors.html") %>% 
  content() %>% 
  xml2::xml_find_all("//code[@class='descname']") %>% 
  xml2::xml_text() %>% 
  unique() %>% 
  sort() %>%
  stringr::str_replace("\\$", "")

# methods listed in this issue (#25)
docs_old <- httr::GET("https://github.com/dfalbel/torch/issues/25") %>% 
  content() %>% 
  xml2::xml_find_all("//li[@class='task-list-item']/code") %>%
  xml2::xml_text() %>%
  stringr::str_replace("\\$", "")

setdiff(docs_new, docs_old)
setdiff(docs_old, docs_new)