Skip to content

contract: test_contract_dot_product assumes specific representation of scalar result #28

Description

@ultimatile

Description

test_contract_dot_product performs a full contraction (dot product) and asserts:

auto c_shape = tci::shape(ctx, c);
TCICT_ASSERT(c_shape.size() == 1);

The TCI v1 spec states "Empty gamma yields a scalar", but the representation of a zeroth-order (scalar) tensor is ambiguous. Backends may represent it as:

  • shape = {} (order 0, shape.size() == 0)
  • shape = {1} (order 1, shape.size() == 1)

The current test assumes the latter, but the CUDA-X backend produces the former.

Questions

  • Should the TCI spec clarify the canonical representation of scalar tensors?
  • Should the conformance test accept both representations?

Affected tests

  • test_contract_dot_product (linear_algebra.h:299)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions