func (tsr *Bits) Eval(res *[]float64, fun EvalFunc) {
	ln := tsr.Len()
	if len(*res) != ln {
		*res = make([]float64, ln)
	}
	for j := 0; j < ln; j++ {
		(*res)[j] = fun(j, BoolToFloat64(tsr.Values.Index(j)))
	}
}
Eval applies given function to each element in the tensor, using float64
conversions of the values, and puts the results into given float64 slice, which is
ensured to be of the proper length
package etensor
import (
	"errors"
	"fmt"
	"log"
	"strings"
	"github.com/apache/arrow/go/arrow"
	"github.com/emer/etable/bitslice"
	"github.com/goki/ki/ints"
	"github.com/goki/ki/kit"
	"gonum.org/v1/gonum/mat"
)
type BoolType struct{}
func (t *BoolType) ID() arrow.Type { return arrow.BOOL }
func (t *BoolType) Name() string   { return "bool" }
func (t *BoolType) BitWidth() int  { return 1 }
type Bits struct {
	Shape
	Values bitslice.Slice
	Meta   map[string]string
}
func NewBits(shape, strides []int, names []string) *Bits {
	bt := &Bits{}
	bt.SetShape(shape, strides, names)
	ln := bt.Len()
	bt.Values = bitslice.Make(ln, 0)
	return bt
}
func NewBitsShape(shape *Shape) *Bits {
	bt := &Bits{}
	bt.CopyShape(shape)
	ln := bt.Len()
	bt.Values = bitslice.Make(ln, 0)
	return bt
}
func (tsr *Bits) ShapeObj() *Shape { return &tsr.Shape }
func (tsr *Bits) DataType() Type   { return BOOL }
func (tsr *Bits) Value(i []int) bool { j := int(tsr.Offset(i)); return tsr.Values.Index(j) }
func (tsr *Bits) Value1D(i int) bool { return tsr.Values.Index(i) }
func (tsr *Bits) Set(i []int, val bool) { j := int(tsr.Offset(i)); tsr.Values.Set(j, val) }
func (tsr *Bits) Set1D(i int, val bool) { tsr.Values.Set(i, val) }
func (tsr *Bits) IsNull(i []int) bool       { return false }
func (tsr *Bits) IsNull1D(i int) bool       { return false }
func (tsr *Bits) SetNull(i []int, nul bool) {}
func (tsr *Bits) SetNull1D(i int, nul bool) {}
func Float64ToBool(val float64) bool {
	bv := true
	if val == 0 {
		bv = false
	}
	return bv
}
func BoolToFloat64(bv bool) float64 {
	if bv {
		return 1
	} else {
		return 0
	}
}
func (tsr *Bits) FloatVal(i []int) float64 {
	j := tsr.Offset(i)
	return BoolToFloat64(tsr.Values.Index(j))
}
func (tsr *Bits) SetFloat(i []int, val float64) {
	j := tsr.Offset(i)
	tsr.Values.Set(j, Float64ToBool(val))
}
func (tsr *Bits) StringVal(i []int) string {
	j := tsr.Offset(i)
	return kit.ToString(tsr.Values.Index(j))
}
func (tsr *Bits) SetString(i []int, val string) {
	if bv, ok := kit.ToBool(val); ok {
		j := tsr.Offset(i)
		tsr.Values.Set(j, bv)
	}
}
func (tsr *Bits) FloatVal1D(off int) float64 {
	return BoolToFloat64(tsr.Values.Index(off))
}
func (tsr *Bits) SetFloat1D(off int, val float64) {
	tsr.Values.Set(off, Float64ToBool(val))
}
func (tsr *Bits) FloatValRowCell(row, cell int) float64 {
	_, sz := tsr.RowCellSize()
	return BoolToFloat64(tsr.Values.Index(row*sz + cell))
}
func (tsr *Bits) SetFloatRowCell(row, cell int, val float64) {
	_, sz := tsr.RowCellSize()
	tsr.Values.Set(row*sz+cell, Float64ToBool(val))
}
func (tsr *Bits) Floats(flt *[]float64) {
	sz := tsr.Len()
	SetFloat64SliceLen(flt, sz)
	for j := 0; j < sz; j++ {
		(*flt)[j] = BoolToFloat64(tsr.Values.Index(j))
	}
}
func (tsr *Bits) SetFloats(vals []float64) {
	sz := ints.MinInt(tsr.Len(), len(vals))
	for j := 0; j < sz; j++ {
		tsr.Values.Set(j, Float64ToBool(vals[j]))
	}
}
func (tsr *Bits) StringVal1D(off int) string {
	return kit.ToString(tsr.Values.Index(off))
}
func (tsr *Bits) SetString1D(off int, val string) {
	if bv, ok := kit.ToBool(val); ok {
		tsr.Values.Set(off, bv)
	}
}
func (tsr *Bits) StringValRowCell(row, cell int) string {
	_, sz := tsr.RowCellSize()
	return kit.ToString(tsr.Values.Index(row*sz + cell))
}
func (tsr *Bits) SetStringRowCell(row, cell int, val string) {
	if bv, ok := kit.ToBool(val); ok {
		_, sz := tsr.RowCellSize()
		tsr.Values.Set(row*sz+cell, bv)
	}
}
func (tsr *Bits) SubSpace(offs []int) Tensor {
	return nil
}
func (tsr *Bits) SubSpaceTry(offs []int) (Tensor, error) {
	return nil, errors.New("etensor.Bits does not support SubSpace")
}
func (tsr *Bits) Range() (min, max float64, minIdx, maxIdx int) {
	minIdx = -1
	maxIdx = -1
	return
}
func (tsr *Bits) Agg(ini float64, fun AggFunc) float64 {
	ln := tsr.Len()
	ag := ini
	for j := 0; j < ln; j++ {
		ag = fun(j, BoolToFloat64(tsr.Values.Index(j)), ag)
	}
	return ag
}