* Copyright (c) 2025 Huawei Technologies Co., Ltd.
* This program is free software, you can redistribute it and/or modify it under the terms and conditions of
* CANN Open Software License Agreement Version 2.0 (the "License").
* Please refer to the License for details. You may not use this file except in compliance with the License.
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
* See LICENSE in the root of the software repository for the full text of the License.
*/
* \file test_dynamic_softmax.cpp
* \brief
*/
#include "gtest/gtest.h"
#include "tilefwk/tilefwk_op.h"
#include "tilefwk/tilefwk.h"
#include "interface/inner/tilefwk.h"
#include "interface/tensor/logical_tensor.h"
#include "interface/tensor/raw_tensor.h"
#include "interface/interpreter/raw_tensor_data.h"
#include "interface/configs/config_manager.h"
#include "interface/tensor/float.h"
using namespace npu::tile_fwk;
class DynamicSoftmaxUtest : public testing::Test {
public:
static void SetUpTestCase() {}
static void TearDownTestCase() {}
void SetUp() override { Program::GetInstance().Reset(); }
void TearDown() override {}
};
TEST_F(DynamicSoftmaxUtest, utest_softmax_dyn)
{
TileShape::Current().SetVecTile({4, 4, 1, 64});
std::vector<int64_t> shape = {32, 32, 1, 256};
DataType dtype = DataType::DT_FP32;
Tensor input(dtype, shape, "input");
Tensor output(dtype, shape, "output");
SoftmaxDynamic(input, output);
}