#if !defined(TORCH_STABLE_ONLY) && !defined(TORCH_TARGET_VERSION) #pragma once #include #ifdef __METAL__ enum class EmbeddingBagMode { SUM = 0, MEAN, MAX }; #else #include using at::native::EmbeddingBagMode; #endif template struct EmbeddingBagParams { ::c10::metal::array weight_strides; ::c10::metal::array output_strides; ::c10::metal::array max_indices_strides; bool use_per_sample_weights; idx_type_t per_sample_weights_stride; idx_type_t num_indices; idx_type_t num_bags; idx_type_t feature_size; idx_type_t num_weights; EmbeddingBagMode mode; int64_t padding_idx; }; template struct EmbeddingBagBackwardParams { ::c10::metal::array weight_grad_strides; ::c10::metal::array output_grad_strides; ::c10::metal::array max_indices_strides; bool use_per_sample_weights; idx_type_t per_sample_weights_stride; idx_type_t feature_size; EmbeddingBagMode mode; int64_t padding_idx; }; template struct EmbeddingBagPerSampleWeightsBackwardParams { ::c10::metal::array output_grad_strides; ::c10::metal::array weight_strides; idx_type_t per_sample_weights_grad_stride; idx_type_t feature_size; int64_t padding_idx; }; #else #error "This file should not be included when either TORCH_STABLE_ONLY or TORCH_TARGET_VERSION is defined." #endif // !defined(TORCH_STABLE_ONLY) && !defined(TORCH_TARGET_VERSION)