question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature suggestion] Identifiers not on both sides of the expression

See original GitHub issue

This seems like it should be (intuitively) plausible:

rearrange(x, 'b -> a b c', a=1, c=1)

to essentially push a vector to be compatible with some other tensors (for broadcasting operations). Currently this throws an error.

One (sort of ugly) workaround is:

rearrange(x, '(a b c) -> a b c', a=1, c=1)

However, it seems like this is a bit redundant and it obfuscates the intent a bit. Thoughts?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
arogozhnikovcommented, Aug 24, 2020

@jotaf98 it is done and available in master branch.

Axes of size 1 can be written as 1, not ().

But also: reduced axes can be anonymous

reduce(image, 'h w 3 -> h w', 'mean')

as well as repeated axes

repeat(image_bw, 'h w -> h w 3')

Same applies to subaxes - name is not required if those are reduced or repeated.

1reaction
arogozhnikovcommented, Aug 4, 2021

@serycjon use repeat if you need to introduce new named axes. Rearrange is strict towards missing identifiers on any side by design

Read more comments on GitHub >

github_iconTop Results From Across the Web

Operators and Identifiers in Power Apps - Microsoft Learn
Identifier names​​ Use single quotes around a name that contains a space or other special character. Use two single quotes together to represent ......
Read more >
Emmet in Visual Studio Code
Make sure to use language identifiers for both sides of the mapping, with the right side being the language identifier of an Emmet...
Read more >
About publisher provided identifiers - Google Ad Manager Help
The Publisher provided identifier (PPID) allows publishers to send Google Ad Manager an identifier for use in frequency capping, audience segmentation and ...
Read more >
Change Face ID and attention settings on iPhone
Change attention settings · Go to Settings > Face ID & Passcode. · Turn on or off any of the following: Require Attention...
Read more >
Web Content Accessibility Guidelines (WCAG) 2.1 - W3C
By publishing this Recommendation, W3C expects the functionality specified in this Recommendation will not be affected by changes to CSS ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found