Skip to content

dr.norm / dr.squared_norm with axis on Tensor type raises TypeError #457

Description

@zihay

Hi,

I’m running into an issue when using dr.norm with a Tensor type. Calling dr.norm (and similarly dr.squared_norm) with an axis argument on Tensorf raises a TypeError, even though the Python stub for these functions exposes an axis parameter. Other reduction operations like dr.sum do work correctly with axis.

Minimal reproducer

import drjit as dr
from drjit.cuda.ad import TensorXf

tensor = dr.ones(TensorXf, shape=(100, 100))
norm = dr.norm(tensor, axis=1)

This currently fails with a TypeError.

I can work around this by manually implementing the norm using dr.sum, but it would be very convenient to have built-in support for axis in dr.norm / dr.squared_norm for tensor types if possible 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions