You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

feature.h 1.5 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * Copyright 2020 Huawei Technologies Co., Ltd
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef DATASET_ENGINE_GNN_FEATURE_H_
  17. #define DATASET_ENGINE_GNN_FEATURE_H_
  18. #include <memory>
  19. #include "dataset/core/tensor.h"
  20. #include "dataset/util/status.h"
  21. namespace mindspore {
  22. namespace dataset {
  23. namespace gnn {
  24. using FeatureType = int16_t;
  25. class Feature {
  26. public:
  27. // Constructor
  28. // @param FeatureType type_name - feature type
  29. // @param std::shared_ptr<Tensor> value - feature value
  30. Feature(FeatureType type_name, std::shared_ptr<Tensor> value);
  31. ~Feature() = default;
  32. // Get feature value
  33. // @return std::shared_ptr<Tensor> *out_value - feature value
  34. const std::shared_ptr<Tensor> Value() const { return value_; }
  35. // @return NodeIdType - Returned feature type
  36. FeatureType type() const { return type_name_; }
  37. private:
  38. FeatureType type_name_;
  39. std::shared_ptr<Tensor> value_;
  40. };
  41. } // namespace gnn
  42. } // namespace dataset
  43. } // namespace mindspore
  44. #endif // DATASET_ENGINE_GNN_FEATURE_H_