mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
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
14 lines
320 B
C++
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);
|
|
}
|