Skip to content

Conversation

@gongchensu
Copy link
Collaborator

@gongchensu gongchensu commented Nov 3, 2025

  1. 增加mul算子Python层的接口,添加测试
image image

import numpy as np


def _scalar_to_tensor(scalar_value, reference_tensor):
Copy link
Collaborator

Choose a reason for hiding this comment

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

torch是这么做的?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
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了

"""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
Collaborator

Choose a reason for hiding this comment

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

依赖torch?

Copy link
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 from 222b774 to 5c89a40 Compare November 5, 2025 07:14
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