Files
pytorch/test/cpp/api/special.cpp
kshitij12345 c4c77e2001 [special] add torch.special namespace (#52296)
Summary:
Reference: https://github.com/pytorch/pytorch/issues/50345

 * Add `torch.special` namespace
* Add `torch.special.gammaln` (alias to `torch.lgamma`)

TODO:
* Add proper entries for docs.
   * [x] Add .rst file entry
   * [x] Add documentation
   * [x] Update `lgamma` OpInfo entry for alias to `special.gammaln`.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/52296

Reviewed By: ngimel

Differential Revision: D26754890

Pulled By: mruberry

fbshipit-source-id: 73479f68989d6443ad07b7b02763fa98973c15f6
2021-03-04 00:04:36 -08:00

14 lines
320 B
C++

#include <gtest/gtest.h>
#include <torch/torch.h>
#include <torch/special.h>
#include <test/cpp/api/support.h>
// Simple test that verifies the special namespace is registered properly
// properly in C++
TEST(SpecialTest, special) {
auto t = torch::randn(128, torch::kDouble);
torch::special::gammaln(t);
}