track(result) {
        if (this.state.activeScope != null) {
            result.scopeId = this.state.activeScope.id;
            this.state.activeScope.track.push(result);
        }
        return result;
    }
Tracks a Tensor in the current scope to be automatically cleaned up
when the current scope ends, and returns the value.

@param result The Tensor to track in the current scope.