Skip to content

Feature/add mul python api#548

Merged
PanZezhong1725 merged 1 commit into
InfiniTensor:mainfrom
gongchensu:feature/add_mul_python_api
Nov 12, 2025
Merged

Feature/add mul python api#548
PanZezhong1725 merged 1 commit into
InfiniTensor:mainfrom
gongchensu:feature/add_mul_python_api

Conversation

@gongchensu
Copy link
Copy Markdown
Collaborator

@gongchensu gongchensu commented Nov 3, 2025

  1. 增加mul算子Python层的接口,添加测试
    测试框架更新后重新修改,测试通过:
image image

Comment thread python/infinicore/ops/mul.py Outdated
import numpy as np


def _scalar_to_tensor(scalar_value, reference_tensor):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

torch是这么做的?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我让他,先看看怎么实现这个功能

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

先去掉了这部分的支持,re-force push了

Comment thread python/infinicore/ops/mul.py Outdated
"""Convert a scalar value to a tensor with the same shape and dtype as reference_tensor"""
# Use torch to create the tensor first (handles dtype conversion correctly),
# then convert to infinicore tensor via from_blob
import torch
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

依赖torch?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的,我先去掉这部分scalar的支持

@gongchensu gongchensu force-pushed the feature/add_mul_python_api branch 2 times, most recently from 222b774 to 5c89a40 Compare November 5, 2025 07:14
@gongchensu gongchensu force-pushed the feature/add_mul_python_api branch from 5c89a40 to a565b36 Compare November 12, 2025 07:48
@PanZezhong1725 PanZezhong1725 merged commit 2286cf7 into InfiniTensor:main Nov 12, 2025
5 checks passed
@gongchensu gongchensu deleted the feature/add_mul_python_api branch December 22, 2025 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DEV] mul算子增加Python层接口

3 participants