Skip to content

Why is ortvalue_from_numpy_with_onnx_type needed to support bfloat16 #24106

Closed
@justinchuby

Description

@justinchuby

Describe the issue

When I was using ortvalue_from_numpy_with_onnx_type, it occurred to me that the input dtypes are already known by the inference session which could simply reinterpret cast any 16-bit input (like uint16) into the desired onnx type. I wonder why we need to specify the types again in ortvalue_from_numpy_with_onnx_type?

To reproduce

N/A

Urgency

No response

Platform

Linux

OS Version

N/A

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

1.21

ONNX Runtime API

Python

Architecture

X64

Execution Provider

Default CPU

Execution Provider Library Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiissues related to all other APIs: C, C++, Python, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions