Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions paddle/phi/core/tensor_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,42 +55,42 @@ class TensorArray : public TensorBase,
static const char* name() { return "TensorArray"; }

/// \brief This overrided function is not used in TensorArray.
int64_t numel() const override;
TEST_API int64_t numel() const override;

/// \brief This overrided function is not used in TensorArray.
const DDim& dims() const override;
TEST_API const DDim& dims() const override;

/// \brief This overrided function is not used in TensorArray.
const Place& place() const override;
TEST_API const Place& place() const override;

DataType dtype() const override;
TEST_API DataType dtype() const override;

#ifndef PADDLE_WITH_CUSTOM_KERNEL
void set_type(const DataType dtype);
#endif

DataLayout layout() const override;
TEST_API DataLayout layout() const override;

#ifndef PADDLE_WITH_CUSTOM_KERNEL
void set_layout(const DataLayout layout);
#endif

/// \brief This overrided function is not used in TensorArray.
bool valid() const override;
TEST_API bool valid() const override;

/// \brief Test whether the tensor's storage in TensorArray is allocated.
/// return Whether all tensors in TensorArray is allocated.
bool initialized() const override;
TEST_API bool initialized() const override;

/// \brief Clear all tensors in TensorArray.
void clear() { tensors_.clear(); }

/// \brief Allocate memory with requested size for all tensors from allocator.
/// \return Void pointer
void* AllocateFrom(Allocator* allocator,
DataType dtype,
size_t requested_size = 0,
bool fake_alloc = false) override;
TEST_API void* AllocateFrom(Allocator* allocator,
DataType dtype,
size_t requested_size = 0,
bool fake_alloc = false) override;

bool empty() const { return tensors_.empty(); }

Expand All @@ -105,7 +105,7 @@ class TensorArray : public TensorBase,
void reserve(size_t n) { tensors_.reserve(n); }

/// \brief Add the tensor to the end of TensorArray
void push_back(const DenseTensor& tensor);
TEST_API void push_back(const DenseTensor& tensor);

void emplace_back();

Expand Down
11 changes: 7 additions & 4 deletions test/cpp/fluid/controlflow/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
cc_test(
conditional_block_op_test
SRCS conditional_block_op_test.cc
DEPS conditional_block_op executor)
paddle_test(conditional_block_op_test SRCS conditional_block_op_test.cc)

if(WITH_ONNXRUNTIME AND WIN32)
# Copy onnxruntime for some c++ test in Windows, since the test will
# be build only in CI, so suppose the generator in Windows is Ninja.
copy_onnx(conditional_block_op_test)
endif()
3 changes: 0 additions & 3 deletions test/cpp/fluid/controlflow/conditional_block_op_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ limitations under the License. */
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/framework/scope.h"

USE_NO_KERNEL_OP(conditional_block);
USE_NO_KERNEL_OP(conditional_block_grad);

using LoDTensorArray = paddle::framework::LoDTensorArray;
using Scope = paddle::framework::Scope;
using Variable = paddle::framework::Variable;
Expand Down