Skip to content

Commit

Permalink
Merge pull request PAIR-code#251 from tvalentyn/asscalar
Browse files Browse the repository at this point in the history
Remove remaining instances of asscalar.
  • Loading branch information
jameswex authored Feb 6, 2023
2 parents a56bc97 + 0a492bb commit 164085a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def GetDatasetsProto(self, datasets, features=None,
bucket = hist.buckets.add(
low_value=buckets[bucket_count],
high_value=buckets[bucket_count + 1],
sample_count=np.asscalar(counts[bucket_count]))
sample_count=counts[bucket_count].item())
# Add any negative or positive infinities to the first and last
# buckets in the histogram.
if bucket_count == 0 and num_neginf > 0:
Expand Down Expand Up @@ -281,7 +281,7 @@ def GetDatasetsProto(self, datasets, features=None,
bucket = featstats.rank_histogram.buckets.add(
low_rank=val_index,
high_rank=val_index,
sample_count=np.asscalar(val[0]),
sample_count=val[0].item(),
label=printable_val)
if val_index < 2:
featstats.top_values.add(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def GetDatasetsProto(self, datasets, features=None,
bucket = hist.buckets.add(
low_value=buckets[bucket_count],
high_value=buckets[bucket_count + 1],
sample_count=np.asscalar(counts[bucket_count]))
sample_count=counts[bucket_count].item())
# Add any negative or positive infinities to the first and last
# buckets in the histogram.
if bucket_count == 0 and num_neginf > 0:
Expand Down Expand Up @@ -286,7 +286,7 @@ def GetDatasetsProto(self, datasets, features=None,
bucket = featstats.rank_histogram.buckets.add(
low_rank=val_index,
high_rank=val_index,
sample_count=np.asscalar(val[0]),
sample_count=val[0].item(),
label=printable_val)
if val_index < 2:
featstats.top_values.add(
Expand Down

0 comments on commit 164085a

Please sign in to comment.