mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 00:21:07 +01:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/70062 This commit upstreams LTCTensorImpl from the lazy_tensor_staging branch. It inherits from c10::TensorImpl and thus manages the lifetime/storage of LazyTensor. Test Plan: ./build/bin/test_lazy --gtest_filter=LazyTensorImplTest.* Reviewed By: desertfire Differential Revision: D33171186 Pulled By: alanwaketan fbshipit-source-id: 6af9f91cc7c7e997f120cb89a7bcd6785c03ace0
18 lines
446 B
C++
18 lines
446 B
C++
#include <gtest/gtest.h>
|
|
|
|
#include <torch/csrc/lazy/core/tensor_impl.h>
|
|
#include <torch/torch.h>
|
|
|
|
namespace torch {
|
|
namespace lazy {
|
|
|
|
// TODO(alanwaketan): Update the following unit tests once the TorchScript backend is merged.
|
|
TEST(LazyTensorImplTest, BasicThrow) {
|
|
EXPECT_THROW({
|
|
auto input = torch::rand({0, 1, 3, 0}, torch::TensorOptions(torch::kFloat).device("lazy"));
|
|
}, ::c10::Error);
|
|
}
|
|
|
|
} // namespace lazy
|
|
} // namespace torch
|