64 TensorShape create_legacy_tensor_shape(int32_t ndims, int32_t *
shape)
66 TensorShape legacy_shape{};
67 for (int32_t d = 0; d < ndims; ++d)
69 legacy_shape.set(d,
shape[d],
false);
73 int32_t *create_tensor_shape_array(
const TensorInfo &
info)
75 const auto num_dims =
info.num_dimensions();
81 int32_t *shape_array =
new int32_t[num_dims];
83 for (
size_t d = 0; d < num_dims; ++d)
85 shape_array[d] =
info.tensor_shape()[d];
95 legacy_desc.
init(create_legacy_tensor_shape(desc.
ndims, desc.
shape), 1,
96 convert_to_legacy_data_type(desc.
data_type));
102 const auto num_dims =
info.num_dimensions();
104 convert_to_c_data_type(
info.data_type()),
nullptr, 0};
114 act = ActivationLayerInfo::ActivationFunction::IDENTITY;
117 act = ActivationLayerInfo::ActivationFunction::LOGISTIC;
120 act = ActivationLayerInfo::ActivationFunction::TANH;
123 act = ActivationLayerInfo::ActivationFunction::RELU;
126 act = ActivationLayerInfo::ActivationFunction::BOUNDED_RELU;
129 act = ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU;
132 act = ActivationLayerInfo::ActivationFunction::LEAKY_RELU;
135 act = ActivationLayerInfo::ActivationFunction::SOFT_RELU;
138 act = ActivationLayerInfo::ActivationFunction::ELU;
141 act = ActivationLayerInfo::ActivationFunction::ABS;
144 act = ActivationLayerInfo::ActivationFunction::SQUARE;
147 act = ActivationLayerInfo::ActivationFunction::SQRT;
150 act = ActivationLayerInfo::ActivationFunction::LINEAR;
153 act = ActivationLayerInfo::ActivationFunction::HARD_SWISH;