Skip to content

Adjust embedding outputs and unwrap ONNX scalar - #237

Merged
1985312383 merged 1 commit into
datawhalechina:mainfrom
1985312383:main
May 11, 2026
Merged

Adjust embedding outputs and unwrap ONNX scalar#237
1985312383 merged 1 commit into
datawhalechina:mainfrom
1985312383:main

Conversation

@1985312383

Copy link
Copy Markdown
Collaborator

Pull Request / 拉取请求

What does this PR do? / 这个PR做了什么?

Use squeezed embedding outputs and add shape comments for BST and DIEN so embedding(...) returns flattened [B, context_dim] where appropriate (pass squeeze_dim=True) and avoid redundant .flatten() calls when building MLP inputs. DIEN: also embed negative history features and document tensor shapes through the interest extraction/evolving logic. Add 'neg_history_features' to extract_feature_info. Update ONNX wrapper to unwrap models that return (output, scalar_loss) by returning only the primary output, preventing a 0-dim tensor from being emitted.

Type of Change / 变更类型

  • 🐛 Bug fix / Bug修复
  • ✨ New model/feature / 新模型/功能
  • 📝 Documentation / 文档
  • 🔧 Maintenance / 维护

Checklist / 检查清单

  • Code follows project style (ran python config/format_code.py) / 代码遵循项目风格(运行了格式化脚本)

Use squeezed embedding outputs and add shape comments for BST and DIEN so embedding(...) returns flattened [B, context_dim] where appropriate (pass squeeze_dim=True) and avoid redundant .flatten() calls when building MLP inputs. DIEN: also embed negative history features and document tensor shapes through the interest extraction/evolving logic. Add 'neg_history_features' to extract_feature_info. Update ONNX wrapper to unwrap models that return (output, scalar_loss) by returning only the primary output, preventing a 0-dim tensor from being emitted.
@github-actions github-actions Bot added enhancement New feature or request | 新功能 model New model or model improvement | 模型相关 labels May 11, 2026
@1985312383
1985312383 merged commit 3a501f0 into datawhalechina:main May 11, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request | 新功能 model New model or model improvement | 模型相关

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant